home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
TP032292.ARJ
/
03-22-92.TPC
Wrap
Text File
|
1992-03-22
|
151KB
|
4,300 lines
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 06:53:26
From Trevor Carlsen
To Derek Westcott
Subject Tp 6.0 Ide
DW> I have to disagree with you on that one. The IDE provides at least
DW> one necessary debugging feature - location of runtime errors in the
DW> code...
That is available in any good programming editor - not just the IDE.
DW> Outside in DOS, all you get is a meaningless address...when you
DW> load up something to find that address, you've got to rerun the code
DW> under the finder utility...
You would appear not to have used Brief, VEdit, Multi-Edit, Unity, QEdit etc.
etc. when they are properly set up.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:21
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 07:58:00
From Trevor Carlsen
To Jud Mccranie
Subject Re: New Reader!
JM> I'm pround of the fact that I've never used assembler,
JM> and I probably never will...
Fine... however there are occasions when such an attitude is going to result
in bloated and/or slower code than is otherwise necessary. To my way of thinkin
a serious programmer has to make use of every possible tool or means at his/her
disposal to produce product that is professional and slick. Restricting yoursel
in the way you state will prevent that final polish.
JM> I wish that was true foe me too, however I know for
JM> sure at least 2 are currently using 8088.
I now restrict myself to coding *only* for '286 or better machines. Now before
all those out there scream and say how silly that is, I am in a situation
totally different to most and therefore such a policy works for me. For most
people, and obviously this applies to you, it wouldn't be possible. However
nothing stops you producing two versions.
JM> Because a major program needs the IDE MORE than a Q&D. Fast
JM> compilation/editing/debugging. The integrated debugger is a
JM> fantastic tool that you don't have anything remotely
JM> comperable (that I know ov) anywhere else.
I agree... it is a fantastic tool. However the point I make is that it is
not really necessary to forego this. TD is more powerful and, given the right
setup with a programmer's editor, almost as easy to use.
How do you use the integrated debugger so frequently that "almost" becomes
a problem? My work style involves debugging small units thoroughly and then
any major problem is in new work. As you can't use assembler, the ID's lack
of a disassembler would not be as important to you as it is to me. The disassem
led code is a great way of seeing faults in your high-level code.
Another couple of points I would raise is your design method. It appears from
your comments that your big work is developed in an ad hoc way. If I am wrong
please don't be offended by this comment, the reason I say this is because
of comments I see from you about several updates per week, constant use of
the debugger, not being aware of the uses and value of exit procedures etc.
What is your big application used for and how many pages of documentation
(particularly the user manual) are involved?
In any big project the design stage is by far the hardest, longest and most
important. Normally most houses would budget on this stage taking 60-80%
of the total project time. Coding and obvious debugging probably represents
less than 20% of the time and effort with the remainder being in-house testing
and acceptance testing and ironing out any bugs this uncovers. By design
stage I mean analysis, functional specifications, general design (screen layouts
and design, program modules, flow etc.), user manu
als and test specifications. Only after this is done, and done properly, is
any coding done. Obviously, as coding proceeds there may be some minor cosmetic
changes needed but any major hitch at this stage requires a proper procedure
for handling this to be implemented.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:21
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 07:40:24
From Trevor Carlsen
To Jud Mccranie
Subject Re: Tp 6.0 Ide
JM> I disagree on the last part. If I test in the IDE with range check
JM> on, then the only thing that can cause it to run differently as an
JM> EXE is an unitialized variable. And that could make it run
JM> differently on different runs whether it was in the IDE or an EXE, as
JM> far as I know.
In any testing a fundamental rule involves testing the limits, upper and lower,
of all data. This involves stack limits, heap limits, the whole works. In
the IDE it would be difficult, if not impossible to do this properly. TSRs
and ISRs cannot really be tested at all from the IDE unless you are fond of
rebooting!
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:21
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 09:12:51
From Trevor Carlsen
To Jud Mccranie
Subject Re: New Reader!
TC> Nothing stops you producing two versions.
JM> I send out 1 or 2 new versions a week. Not worth it for the cunfusion
JM> for such a small benefit.
Are you serious?
TC> I don't think I am aware of ONE thing that they cannot do that
TC> the IDE does (apart from display a Borland Copyright notice :-)
TC> ), and they have MANY functions not available in the IDE - some
TC> insignificant but some really major.
JM> Do they have the integrated debugger? Case closed.
No they don't... but the case is not closed. Good design should minimise
the use of the debugger to only the relatively harder bugs. Then TD comes
into its own. And it is still only one keypress away.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:22
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 09:18:13
From Trevor Carlsen
To Jud Mccranie
Subject Re: Longer files in TP5
TC> The TP5 IDE is severely crippled. The TP6 IDE will allow you
TC> to edit large files and its help system is significantly larger
TC> and better than that in TP5. (Mind explaining why you consider
TC> the help system to be inferior?)
JM> He shouldn't be using single files that large anyway. ...
Why? I agree that the source code should never approach that size in a normal
situation but it is normal to expect that comments and documentation in the
source file to exceed the actual source size. Also there are *many* times
you will want to load and read/edit much larger files that may not actually
be part of the program.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:22
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 09:22:43
From Trevor Carlsen
To Jud Mccranie
Subject Re: Pascal, The Language
TC> Power and flexibility are usually mutually exclusive and
TC> therefore should not be grouped together like that. Assembler
TC> is *by far* the most powerful language one can use. NOTHING
TC> comes a close second.
JM> You are equating Power to speed of execution and size of the
JM> EXE, I beleive. ...
Not completely. I define power as the ability of a language to do something.
There is nothing that can be done in a high level langauge that cannot be
done with assembler, albeit it with more difficulty. The reverse does not
apply, therefore assembler is the more powerful.
JM> ... Try expressing a complex algorithm in assembler
JM> and see how powerful it is.
I didn't say "it is easier to do in assembler", I said it is by far the most
powerful. High level languages are primarily there to help the programmer
avoid the drudgery and difficulties of using assembler. The power of a language
is not how easy it is for a programmer to achieve something in that language
but how efficient and capable the language is in executing that something.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:22
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 09:31:16
From Trevor Carlsen
To Kevin Higgins
Subject Run Time Error 162
KH> Is there anything thing I could do in my code which would
KH> cause a run time error 162 (hardware failure)? I got a
KH> report of this from a beta tester on a program after I
KH> implemented the sort routine you helped me with (it works
KH> fine on most machines -- this may be an isolated instace,
KH> but the guy's system is sound...) Using the program with my
KH> old, inefficient sort, it works fine, but with the new quick
KH> sort you showed me he gets this error.... anything come to
KH> mind?
Without being able to get my hands on the program I could not tell. I would
suspect some kind of memory overwrite. By memory the routine I supplied you
with could do this, even with range checking enabled, so you need to be absolute
y sure of preventing out-of-range errors.
All the usual caveats apply, watch unitialised pointers, single step through
in the debugger etc. etc.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:23
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 09:37:57
From Trevor Carlsen
To Thomas Groff
Subject Mucking about with disk files.
TG> I recently saw a message someone posted asking how to slip some
TG> data into the start of a file that already contained data and
TG> it got me to thinking about disk files in general.
TG> Wouldn't it be possible to: 1. create a file containing new data.
TG> 2. delete an old file (The one you want to append.)
TG> 3. twiddle the disk's file allocation table and directory entry to
TG> use disk space occupied by the erased file for the new file.
TG> 4. reopen the new file and push the file pointer to include the
TG> erased files data.
I'd forget that idea very quickly if I were you! It would only work if the
data to be added exactly matched the size of a cluster and even then would
be tricky and dangerous. Not worth the effort.
TG> Has anyone tried this? Or does DOS not allow one to specify
TG> Just what disk area is going to be used next.
No and no.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:23
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 09:42:31
From Trevor Carlsen
To Robert Kantor
Subject Help!
RK> I am trying to utilize a two dimensional array. The first field will
RK> contain numbers the second a string of 12 characters. Does anyone
RK> have a routine which will take the first field (numbers) and sort it
RK> and the corresponding strings will be sorted too?
Better that you use a singly dimmensioned array of records to achieve that.
type
YourRecord = record
number : word;
TheStr : string[12];
end;
var
YourArray : array[min..max] of YourRecord;
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:23
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 09:48:19
From Trevor Carlsen
To John Reid
Subject Archiver
JR> * SMRead 3.0 #0286 *
^ ^
John you may not be aware of it but your reader/editor is placing hi-bit charact
rs in the indicated positions. Please fix if possible.
Trevor Carlsen
Moderator.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:23
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 09:53:01
From Trevor Carlsen
To Andrew Broughton
Subject Variable-Length Records
AB> Does anyone out there know of a (fast) way to get to a specific record
AB> in a file that has variable-length records? What I have is a file with
AB> sorted records, each ending in the same terminator, but of varying
AB> length. What I want to do is be able to do a binary search on the
AB> file, but I need a way to
AB> jump to specific records.
It is simple to do by creating an index file. Do this by reading through
the file and recording in the index file the location of each terminator.
If this is still not sufficient ask again.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:24
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 10:01:22
From Trevor Carlsen
To Jud Mccranie
Subject Re: New Reader!
RM> In some cases I have been required to use a particular editor
RM> to conform with team requirements, specifically with version
RM> control or standard metrics. This is a contract stipulation
RM> that is common for commercial programmers.
JM> Not to detailed specs. They tell me what they want it to do and
JM> I do it. Then if they want it changed I change it. I don't have
JM> to conform to team requirements.
A 400k .exe is a big program and could easily represent man-years of effort
by a programmer. Such a program would be highly unlikely to be developed
by a one-man show unless the major part of that 400k is taken up by third
party library stuff. As such and in total it probably still represents man
years of effort.
I would not consider contracting a big job with someone who cannot either
provide detailed written specifications or alternatively sit down with me,
or a team, and come up with those detailed specifications. It is simply not
viable to quote a price without that being done. And if I could find someone
stupid enough to contract me to do a big project on an hourly basis, I would
be in seventh heaven. Successful businesses do not do that sort of thing!
JM> Well, I can bet that if the program will fit in the TP IDE, I can
JM> develop faster and better than anyone using Brief, QEdit, etc because
JM> of the power of the integrated debugger.
I can place only one interpretation on that statement and that is that you
develop "as you go". On smaller or unimportant jobs I guess that many of
us work that way and that would definitely make the ID a more important factor.
(I know that too often I work that way thinking that I can get away with the
slackness because of the nature of the task.) On serious jobs though, that
method will produce poor code and poorer programs, necessitating frequent
revisions due to simple bugs or unplanned improvements. I would be willing
to bet many dollars on a professsional programmer with a professional editor
and professional set of tools being more productive than if he was using the
IDE and the same tools.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:24
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 13:31:17
From Trevor Carlsen
To Jud Mccranie
Subject Re: New Reader!
DM> I'm sort of curious why you'd be proud never to have used a
DM> useful tool, but it's hardly a Pascal topic, so I won't ask.
JM> Because I use only high-level languages. I write app progs, not
JM> utilites or system progs. As far as speed, it is often easier to
JM> write a fast one in a high-level language than assembler. For
JM> instance, an average version of quicksort in Pascal will easily
JM> outrun a tight assembler implementation of bubblesort.
Of course it is and of course it will! But you are comparing a Ferrari towing
a trailer to a small car. Take the trailer off the Ferrari by using assembler
AND a QuickSort and there is once again no contest. Sorting and searching
are excellent examples of code in ordinary everyday applications that benefit
substantially by the use of assembler, substantially enough to make a significan
impact on the perception of the application by the end user.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:24
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 13:45:27
From Trevor Carlsen
To Jud Mccranie
Subject Re: Tp 6.0 Ide
JM> I've never seen a case where the program rn differently in the
JM> IDE instead of EXE unless there was a dumb bug.
I'm not sure of this but do programs running in the IDE using the PrefixSeg
variable operate correctly? (I have no way of checking without re-installing
the IDE)
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 13:48:44
From Trevor Carlsen
To Jim McNamee
Subject TP 6.0
JM> One inclusion I've been waiting for is dynamic or conformant arrays.
It would be a nice addition even though it is easy enough to pseudo implement
yourself using untyped parameters.
JM> At the moment, to pass array data to a Proc or Function one must
JM> explicitely use pointers or sprinkle typed constants throughout .TPUs
JM> to assure that passed arguments are identical between called and
JM> calling code.
I feel that this is not quite correct if my above suggestion is used.
JM> ... The ISO standard would allow determination of array
JM> size at run-time allowing arrays to be passed more easily.
Undoubtedly.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 13:54:45
From Trevor Carlsen
To Ken Koch
Subject IDE's
KK> I just downloaded an IDE called UNITY310. This program looks
KK> great except for 1 thing. It does not let you specify the
KK> multiple directories, like the default TP 5.5 IDE does. Like
KK> setting up your include directories, or the object
KK> directories, etc. Is there any other IDE out there that
KK> provides this function.
Welcome to the club :-) Your productivity will increase remarkably! The
problem you are having is not due to Unity but to your config file for TPC.
Set that up correctly and Voila!
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 13:58:55
From Trevor Carlsen
To Jud Mccranie
Subject Re: Pascal Vs. C
DN> Sounds good. Is Modula 2 more or less low-level capable than
DN> TP?
JM> Modula-2 is more low-level capable than Pascal...
True. However if you were to say "Turbo Pascal" then I believe that the stateme
t is incorrect.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 14:10:13
From Trevor Carlsen
To Mark Sandfox @ 970/201
Subject Memory
MS> I have a large source code 400k+ that I can not compile. I keep
MS> recieving segment too large...
What is the actual error message? Read the manual for information on the
actual error message you are receiving.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 14:13:47
From Trevor Carlsen
To Mark Sandfox @ 970/201
Subject Files
MS> How can I make a data file unreadable to the user? Besides
MS> incription.
Probably encryption is your only means available.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:26
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 16:06:20
From Trevor Carlsen
To James Digiacomo
Subject Dynamic Arrays in Turbo Pascal
JD> the problem occurs when I try to display the contents stored in this
JD> type of array. it seem to contain the data PLUS additional garbage
JD> characters. As a reminder, it only happens when I compile my program
JD> here's the declaration part of my program:
JD> TYPE
JD> item = string;
JD> limittype = array [1..1] of item;
JD> numbertype= array [1..1] of item;
JD> VAR
JD> Lim : ^limittype;
JD> temp, numbers : ^numbertype;
JD> I use TP's GETMEM procedure to allocate the memory for these arrays
JD> and after the program is finished, I release the allocated memory
JD> using the procedure
JD> FREEMEM.
You have not indicated the actual allocation and deallocation. That is the
important part. Also show some examples of reading and assigning array element
values.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:26
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 16:09:17
From Trevor Carlsen
To Bill Pantoja
Subject Re: Files
BP> If you wirte a fast encryption scheme (Other then a simple
BP> NOT or XOR encryption), you can encrypt a 200MB file in
BP> under 30 seconds.
I simply refuse to believe that this is possible. That represents 6.67 megabyt
s per second. On a 486 33mHz even a simple no content loop does not execute
that fast. eg
for x := 1 to 200000000 do;
will take longer than 30 seconds. On top of that you have all the necessary
[slow] disk accesses.
BP> program I wrote for the Medical Board Of California, all the
BP> data file were required to have a bullet-proof encryption
BP> scheme. Using a combination of NOT, random translation
BP> tables, etc. I came up with a very good encryption scheme
BP> which uses a negligable amount of time. The data file is
BP> over 2.7MB but by encrypting or decrypting the data in
BP> memory rather then on disk, it speeds up the program and
BP> protects against leaving the data "bare" on your disk if a
BP> user reboots the machine.
About the only "bullet proof" encryption is what is known as a "one time pad"
method. The encryption standard used by the US department of defense has
so far defied attempts to break it but no mathematical proof exists of it
being impossible. It is also very slow on a PC.
Encryption of sensitive data can be made *almost* impossible to break without
recourse to heavy duty computer usage/power and plenty of time, skill and
imagination. Non military or diplomatic data is rarely sufficiently valuable
to make the effort worth the expense and even then then time constraints may
defeat it.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:26
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 20:11:08
From Trevor Carlsen
To Greg Williams
Subject Generating sequential file names...
GW> Does anyone have an efficient method of generating the next filename
GW> in a sequence of names like the following:
GW> File000.ext
GW> File001.ext
GW> File002.ext
GW> .
GW> .
GW> Where the number can be anything up to the whole eight characters
GW> allowed for a filename (ie. something like "00000231.ext")...
GW> Up to now, I've been asking DOS to pass me a "unique" filename, but
GW> that is no good if you want to see at a glance which is the latest...
Keep the next number + 100000000 in the sequence as a longint in a file and
just use TP's str procedure to produce the file name.
var
fname : string;
fnumber : longint;
str(fname,fnumber);
fname := copy(fname,2,8) + '.' + ext;
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/15 15:45:27
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-16-92 06:27:03
From Trevor Carlsen
To Scott Hutchinson
Subject Hiya
SH> randomize;
SH> writeln(random(1000));
SH> This will generate a random number between 1 and 1000. If you want it
SH> to generate a number on a larger scale, use a number larger than 1000.
SH> If you have any more questions, I'll be glad to answer them for you.
Thanks...but try to answer them accurately! :-)
The above will display a random number ranging from 0 to 999.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/16 19:51:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-16-92 16:22:49
From Trevor Carlsen
To Jud Mccranie
Subject Re: Pascal Structure Philosophy
JM> In the example he gave, he doesn't have to set the variable, and that
JM> is one of his main points. The variable is not checked until the end.
JM> The "error" variable is set automatically when the file is opened.
The only time it makes any difference is at the start of the looping construct
and therefore it is of little or no consequence. The easiest way is to start
the loop by an if statement and then place both checks at the end of a repeat
loop. That way he avoids the required setting of the variable that he dislikes,
code size is identical and execution time is probably the same.
To set up a completely new and unnecessary looping construct is a strange
attitude.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/16 19:51:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-16-92 17:33:47
From Trevor Carlsen
To Jud Mccranie
Subject TP 6 Bad design
JM> First is execution speed. I believe I have the same options in
JM> both, as far as checks, alignment, etc, however, I got the following
JM> results on the exact same source:
JM> TP 5.5 22.24 seconds
JM> TP 6 G- 22.90
JM> TP 6 G+ 22.91
JM> 286 instructions made no difference, and 5.5 executes 3% faster than
JM> either of of them. Maybe I've done something different, but I don't
JM> think so. (I'm using Eagle's system on both.)
I decided to set up the TP6 IDE again so I could test this. Obviously I cannot
comment on the actual results of yours as I don't know what your code was.
As you have stated elsewhere that all your testing is done in the IDE, the
above would be an invalid test if that is the method you used in your testing.
The TP6 IDE is an event driven environment and unless it releases ALL hooks
for that environment when executing a program from within itself, which I
do not think it does, a certain amount of time is needed to service those
hooks. Because of this it is obvious, or should be to an experienced programmer
that a program running from within the TP6 IDE will always be slower than
when the same code is executed from the command line. That is exactly how
it turned out in my testing.
In the test my test program was 9% slower running in the TP6 IDE than when
executing from the DOS command line. It was about 7.4% slower in the TP6
IDE than when compiled with TP5.5 and run from the command line. However
when both versions were executed from the command line the TP6 version was
about 1.7% faster than the TP5.5 version.
I was unable to do a test running from within the TP5.5 IDE but I would have
thought a 3% figure might have been a little on the low side. I think that
the TP5 IDE hooks some vectors also, perhaps the discrepancy may be there,
although without me running exactly the same set up as you it is a little
pointless to compare my results to yours. Suffice it to say that bench mark
testing from within different IDEs is invalid and I am very surprised that
someone with your stated experience and knowledge would do that (if in fact
you did, as appears likely from your results).
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/16 19:51:36
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-16-92 15:40:52
From Trevor Carlsen
To Gene Buckle
Subject Re: Bbs Source.. / Range Checking
GB> ... I am getting a range check error on one of his functions
GB> that returns a boolean value. I dies at "GetLogin := rcs"
GB> where rcs is boolean (and is set to true or false depending
GB> on what info is gathered in the body of the routine). It
GB> works just fine if I $R-, but with range checking on, it
GB> dies.
The easy way is to place the following lines immediately prior to the line
in question -
if (byte(rcs) <> 0) and (byte(rcs) <> 1) then begin
writeln('rcs has not been correctly initialised');
halt;
end;
I believe that you will find that rcs is not being initialised where you think
it is - perhaps an if-then-else-if-then statement's logic is off or a value
parameter is used where a reference parameter is needed.
Place a watch on it in the debugger to find out just when and how it is being
initialised. The result may surprise you.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/16 19:51:37
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-16-92 15:49:34
From Trevor Carlsen
To Gene Buckle
Subject Re: Bbs Source..
GB> ... rcs is being initialized to FALSE at the beginning of the func.
Why not post the function?
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/16 19:51:37
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 16:21:00
From Werner Berghofer
To Jud McCranie
Subject Longer files in Turbo Pascal 5
Jud,
> I con't consider TP 5 IDE "severely crippled" because of that.
> In fact, it is BETTER that the editor limit the files to 64K.
no doubt about the second statement, you are right. But how else than
"severly crippled" would you call an editor which offers you Ctrl-Alt-Del
as only option if during editing (block copying etc.) the size of a source
file exceeds 64 KB?
I'm very glad that Borland removed this not really seasonable editor
limit in version 6.0 of Turbo Pascal.
W.
---
* Origin: God is real... unless declared integer. (2:310/90.100)
* Tossed by SFToss v1.00b on 92/03/17 04:34:44
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 08:22:31
From Dj Murdoch
To Jud Mccranie
Subject Re: TP 6.0 IDE memory
MO> BTW if you can't adapt to the 6.0 IDE, don't despair,
MO> Borland Pascal++ is just around the corner ;-)
JM> That's what I've heard. I hope they take the users into
JM> consideration this time. They were headed in the wrong direction
JM> w/ 6.0 IDE, IMHO.
It's probably too late to make any difference now, but what sort of changes
were you looking for?
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/17 11:00:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 08:25:12
From Dj Murdoch
To Dale Frakes
Subject Re: Binary Tree Linked Lists
> Actually B-Trees are more effecient than Binary tress and
DF>
DF> I thought the B in B-tree stood for Binary. What is the
DF> difference between a b-tree and a binary tree? (Just a
DF> basic explanation, I don't want source and such).
B is for Balanced - to the extent possible, every node has the same number
of subnodes. A binary tree can be so imbalanced as to be nearly a linked
list, if new nodes are always added on the right, for instance.
It's quite hard & time consuming to do adds & deletes to a balanced tree,
but the searches are fast. A compromise method that allows easy adds and
deletes, but is 20 or 30 percent slower on searches, is a Skip List. It's
a list with multiple indices: there's one level that lists every node, the
next level skips a few each step, the next one skips a few of those, etc.
You start at the top level (fewest nodes) and do a linear search of 2 or
3 nodes to find the starting place at the next level.
The key thing that makes adds & deletes quick is that each new addition is
done completely independently of whatever is there. You *randomly* choose
(according to a geometric distribution) how many levels a new addition should
fit into, and just add it to those.
Look in the June 1990 issue of the Communications of the ACM for an article
discussing these, or look on PDN Pascal nodes for SKIPLIST.ZIP containing
some sample code.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/17 11:00:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 08:37:04
From Dj Murdoch
To Ruurd Pels
Subject Re: Turbo Vision Questions...
RP> No sir it ain't! You are having a misconception about the
RP> nature of TV. It is not a collection of things. TV is a
RP> closely coupled class hierarchy containing a whole
RP> template program, ready to run. Apart from the TCollection
RP> class and it's descendants, it is ONE class hierarchy.
And apart from the TStream class and its descendants, and the TStringList,
and the TResourceFile. All of which are useful in programs that have nothing
descended from TView.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/17 11:00:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 08:40:34
From Dj Murdoch
To Joshua Kersey @ 930/22
Subject Re: Turbo Vision Questions...
JK> Yes...but the fact remains that it still *IS* OOP, which
JK> I'm not good with and can hardly apply with a good spray
JK> bottle and a can of paste. I'd like to see Turbo Vision
JK> WITHOUT the OOP, something I could actually use without
JK> re-learning Pascal.
I can't imagine what TV without OOP would be. Do you just mean a windowing
library? There are lots of those. The best would be Turbo Professional,
I've heard Turbo Technojock's Toolkit is good, and Blaise sells something.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/17 11:00:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 08:43:46
From Dj Murdoch
To Jud Mccranie
Subject Re: Why I Like Tp 5.5 Ide (co
JM> So the "O" should be BLACK - not cyan. I look at "OK" and I think
JM> the the hot letter should stand out. In the other cases, the yellow
JM> stands out from the black. But in the case of "OK", with only two
JM> letters (one cyan, one yellow), there is no way to tell which is
JM> the hot letter unless you compare it to the rest of the screen, or
JM> you rember "in that case, the yellow is the hot letter, and the
JM> cyan one isn't" and the user shouldn't have to remember that. He
JM> should be able to tell at a glance which is the hot letter w/o having
JM> to compate it with the rest of the screen or rember an arbitrary rule.
The trouble is that OK is special in two ways. That's why it looks different
than any other button. Seems smart to me...
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/17 11:00:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 08:46:12
From Dj Murdoch
To Jud Mccranie
Subject Re: TP 6 Bad design
JM> I've been trying TP 6 again, and I've encountered even more
JM> problems.
JM> First, let me say that memory is no longer the hangup. However,
JM> everything else I've spoke of is still a problem, and I've
JM> encountered several more pretty bad problems.
JM> First is execution speed. I believe I have the same options in
JM> both, as far as checks, alignment, etc, however, I got the following
JM> results on the exact same source:
JM> TP 5.5 22.24 seconds
JM> TP 6 G- 22.90
JM> TP 6 G+ 22.91
$G+ can be slower than $G-, because of the bad implementation of ENTER and
LEAVE on the 80x86 family. Borland should never have touched them. That's
the only difference I would have expected. Can you identify where the time
is being spent?
JM> After you go through all of the tough song and dance to change an
JM> option, if you don't OK it, the change doesn't take effect. If
JM> you F10 or escape from the menu w/o "OK"ing it, the change is lost.
JM> This is an extremely bad design flaw. The last thing you saw on
JM> the screen should be the options in effect.
What do you mean "if you F10"? That doesn't do anything in the menus on my
system. The Escape behaviour is good, in my opinion. After you've made a
pile of changes, it's nice to be able to accept them (Enter) or abandon them
(Esc). Do you think it should ask if you really mean to abandon the changes?
JM> When you escape from a option menu, it puts you back in the editor
JM> rather than the menu. This is bad design.
That's because options shouldn't be in menus, they should be in dialog boxes.
Yes, the menu system in TP 6.0 isn't well designed.
JM> With TP 5.x, I can hit F9 anywhere in the IDE to compile. In 6.0,
JM> you have to get out of a menu first. This is very bad design.
There's a difference of philosophy here. In a dialog box, the changes you
are making aren't applied until you hit Enter or Okay. If you were allowed
to do a compile while in this state, you'd be compiling with the old options.
Perhaps there should be a "Accept all options and compile" hot key, but people
mostly don't spend a lot of time flipping options, so it's probably not worth
adding.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/17 11:00:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 09:00:29
From Dj Murdoch
To John Gohde
Subject Re: Ide Design
JG> My
JG> IDE currently has a limit of about 250K or about 7,500 lines or
JG> apparently 4 times the 5.5 file size limit. That may improved by
JG> release time, but I honestly don't think a programmer's editor
JG> needs to deal with really big files. That feature would only take
JG> up RAM.
But sometimes programmers need to edit big files that aren't programs. A
programmer's editor doesn't need to be optimized for these, but it's very
handy if it can handle them.
For example, if you were writing a nodelist compiler, and you wanted to stress
test it, you might put some weird errors into a full size version of it.
It's nice to be able to do this in the same editor you're using for everything else.
JG> The clipboard never made a whole lot of sense to me as it adds an
JG> extra step. In my IDE, with F7/F8 you can move blocks directly
JG> from source window to destination window or you can implement a
JG> clipboard approach by using the Delete Buffer (of 300 or whatever
JG> lines). 8-)
That's a big improvement. I hate the clipboard.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/17 11:00:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 09:11:58
From Dj Murdoch
To Richard Morris
Subject Re: Ancestor VMT
> (P = Typeof (Self)) or Parent.DescendsFrom(P);
RM> MMMM<grin>mmmm, you see what I mean!
>> If each Object in TP saved it's ancestor's VMT segment in it's
>> virtual method table then I could query along the chain until I got
>> to the desired object or a nil VMT segment indicating trhe chain
>> ended with the root Object Type. This would extend to the Turbo
>> vision heirachy.
> I see the benefits of the feature. Have you written
> Borland?
Thinking about this, I see a very big problem both with the code version above
and the modification to the VMT. It would really interact badly with the
TP linker, as follows:
Currently, the VMT is only linked in if there's a direct or indirect reference
to it. TypeOf(Self) makes a direct reference to the VMT; calling a constructor
(without the type modifier prefix) makes an indirect reference to it. There
aren't any other references that I can think of to the original VMT; all virtual
method calls, for instance, use the pointer in the object, not the fixed VMT
address.
Same thing for code. Code is only linked when you give a direct reference
(e.g. call a procedure or static method, or a virtual method with a type overrid
) or an indirect reference. Indirect references include using procedures
that make direct references, use another routine in the same .OBJ file, or
(and this is the point), make some reference to the VMT.
If you link a type's VMT, you get all the virtual methods, whether you need
them or not.
So what's the point? Well, think
about that DescendsFrom method or the VMT modification described below it.
It makes a direct reference to its VMT. It also makes a direct reference
to Parent.DescendsFrom, which makes a direct reference to the parent VMT,
and so on. That means that *every* VMT and hence every virtual method for
any ancestor of any object you construct will be linked into your .EXE.
The only way I can see around this problem is to improve the TP linker so
that it takes account of which VMT entries are needed and which aren't.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/17 11:00:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-16-92 21:29:05
From Dj Murdoch
To Trevor Carlsen
Subject Re: Tp 6.0 Ide
DW> I have to disagree with you on that one. The IDE provides at least
DW> one necessary debugging feature - location of runtime errors in the
DW> code...
TC> That is available in any good programming editor - not just the IDE.
Read what he wrote - he's talking run-time errors, not compile errors. To
get those from other editors you generally have to recompile with the /F option,
and retype the address.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/17 11:00:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-16-92 21:36:20
From Dj Murdoch
To Hans Siemons
Subject Re: TP 6.0 disassembler...
GW>> 6.0 It's called TPU60.* (comes to about 120K) and "decompiles" TPU
GW>> files, including all constants (internal or external), all
GW>> procedures/functions, objects (untested as yet), optionally provides
GW>> assembly code (ie. disassembles each procedure) and cross-references
GW>> everything, and even includes the names of the *.OBJ files (if any)
GW>> you linked in as external procedures!
DM> Yes, I've seen that one, and it's really good. If
HS> you want to patch a
DM> .TPU file, that's the one to get.
HS> Hmm, I want to get it! Do you know where I can freq this
HS> baby? On 14k4 if possible (I don't mind requesting
HS> oversees as long as it not on 2400bps ;-)).
I sent it out on the PDN Pascal file echo in October last year as TPU6.ZIP.
It's probably available closer to you, but the only system I know of for
sure is 1:221/177. That's 14.4 HST, but I've heard from Europeans that they
have trouble connecting, so watch out that you don't make a lot of wasted
phone calls.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/17 11:00:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-16-92 21:44:56
From Dj Murdoch
To Rob Kittredge
Subject Re: C++ products
RK> Terry,
RK> I seem to like TP's style better than C's, but I like
RK> the C++ (3.0) IDE and project management features. After
RK> playing with C++'s project management, I can see that (to
RK> me) it is far superior than specifying the usual 10-15
RK> USES list in EVERY unit that I write! Most of which are OP stuff :-).
I though in C++ you generally had to include header files, so you'd end up
with just as many includes as you now have uses. But even if I'm wrong, it
doesn't sound like a great style. Units should be focussed - they should
have a clear purpose. For me, this generally means that they don't get 10
or 15 units in the Uses list - more like 5 or 6. The main program (or the
unit that dispatches commands to the other units) often ends up with more.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/17 11:00:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-16-92 21:49:22
From Dj Murdoch
To Andrew Knobloch
Subject Re: Data Compression Techniques ********
AK> I program mainly in Turbo PASCAL (with some assembly
AK> language on the side)... Anyhow, I'd really like to know
AK> how to compress files and data structures from within a
AK> PASCAL program. One algorithm that I do have is called
AK> Huffman Encoding. Not only is Huffman Encoding slow but
AK> it only squishes TEXT files by a maximum of 20 or 30
AK> percent. Hardly worth any squishing at all. Anywayz, if
AK> anyone knows of a good compression algorithm that is not
AK> necessarily fast, let me know.
Look for TPLZW. It was written by Wilbert van Leijen, and does good Lempel-
Ziv-Welch compression pretty quickly. It won't compress a small file, but
on a long enough text file (e.g. 24K) you get 50 or 60 percent compression.
If you can't find it, hold on for a few days (weeks?). I'm going to release
a unit of stream utilities that makes use of Wilbert's code to compress any
stream.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/17 11:00:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-16-92 21:57:22
From Dj Murdoch
To Jud Mccranie
Subject Exponentiation (was: Are you...)
JM> Don't hold your breath. I requested the exponential operator back
JM> in 2.0 or 3.0. I even requested in the USCD Apple Pascal days. They
JM> called me on the phone and told me how to do it (I knew that, of
JM> course). They can write a better one than I can.
Something that's changed since then is the publication and acceptance of the
new Extended Pascal standard. It has an exponentiation operator ("**", like
Fortran). I don't know if Borland has any intention of paying attention to
the new standard (any more than they paid attention to the old one :-), but
other vendors on other machines (e.g. VAX Pascal) are.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/17 11:00:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-16-92 22:01:51
From Dj Murdoch
To Ivan Samuelson
Subject Re: C+ vs Turbo Pascal
IS> Just C in general is an excellent language. I've got both
IS> Turbo Pascal and C++. but if you want a language that
IS> allows you flexibility in manipulating right down to the
IS> bits, C is the way to go. Pascal is VERY restrictive in
IS> what you can and cannot manipulate.
Standard Pascal is very restrictive, but I can't think of anything in C that's
impossible in TP 6. Could you give some examples? I suspect you just aren't
familiar enough with it.
There are definitely cases where the C construct will be more efficient &
probably shorter to code, but I don't think there's anything that just can't
be done in TP. (There are also cases where the TP code will be more efficient
and/or shorter. For example, compile the TurboCalc sample program in both
C & TP, and I think you'll find the TP version is smaller.)
IS> Pascal was created to be a learning language. It was and
IS> is used to teach programming techniques in
IS> structured/modular programming. Hence, it doesn't allow
IS> you to manipulate on the bit-wise level of computing.
IS> Also, Pascal will do range checking on arrays. If you step
IS> out of bounds, Pascal will catch it. C WON'T do that. You
IS> have to do it yourself. That's where some will see the
IS> downfall of C while others, like myself, say it's great. C
IS> gives YOU the responsibility to check everything, which
IS> allows for greater flexibility in programming.
Now I'm sure it's because of unfamiliarity. In TP, the $R option controls
whether range checking takes place. Turn it off if you don't want it.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/17 11:00:30
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-17-92 03:33:28
From Trevor Carlsen
To Ivan Samuelson
Subject C+ vs Turbo Pascal
IS> Just C in general is an excellent language. I've got both Turbo Pascal
IS> and C++. but if you want a language that allows you flexibility in
IS> manipulating right down to the bits, C is the way to go. Pascal is
IS> VERY restrictive in what you can and cannot manipulate.
IS> Pascal was created to be a learning language. It was and is used to
IS> teach programming techniques in structured/modular programming. Hence,
IS> it doesn't allow you to manipulate on the bit-wise level of computing.
IS> Also, Pascal will do range checking on arrays. If you step out of
IS> bounds, Pascal will catch it. C WON'T do that. You have to do it
IS> yourself. That's where some will see the downfall of C while others,
IS> like myself, say it's great. C gives YOU the responsibility to check
IS> everything, which allows for greater flexibility in programming.
When comparing languages it is only fair to do so if you know what you are
talking about. The above comments that you make about Pascal are true if you
are referring to standard Pascal. However your subject line AND the first
quoted line above would indicate that you are referring to, or at the very
least including, Turbo Pascal in your assertations. If so then your statement
is wrong on several points.
TP *can* easily manipulate bits.
(Operators used for this are shl, shr, and, or, xor, not)
TP *can* disregard range checking of array bounds.
(Read up on the R+/- compiler directive)
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/17 20:24:20
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-17-92 04:11:45
From Trevor Carlsen
To Jan Hoolwerf
Subject Pascal <==> C string translation
JH> Probably not a new question but i would appreciate to have some
JH> routines to translate C strings (null terminated) to Pascal strings.
JH> And back to C strings. :-)
C strings are just arrays of characters that are terminated by a nul character.
TP strings are arrays of characters that use the zero element of the array
to indicate the length of the string. Naturally this limits TP strings to
255 characters.
function Asc2Str(var s; max: byte): string;
{ Converts an ASCIIZ string s to a Turbo Pascal string }
{ with a maximum length of max. }
var starray : array[1..255] of char absolute s;
len : integer;
begin
len := pos(#0,starray)-1; { Get the length }
if (len > max) or (len < 0) then { length exceeds maximum }
len := max; { so set to maximum }
Asc2Str := starray;
Asc2Str[0] := chr(len); { Set length }
end; { Asc2Str }
type
CStr = array[0..255] of char;
procedure TPStr2Asc(var s: string; var a: CStr);
{ Converts a TP string s to a nul terminated C string a }
begin
a[length(s)] := #0;
move(s[1],a[0],length(s));
end; { TPStr2Asc }
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/17 20:24:20
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-17-92 06:13:58
From Trevor Carlsen
To Gerald Gutierrez
Subject Printer Status
> Let's Stamp Out Assembler on Pascal! ;-) Gee, I bet the assembler
> solution will save me .000000043 seconds execution time in my
> program. What a lost.
GG> And just a COUPLE bytes of exe data.. :) Pascal is fine for small
GG> applications that don't take much time -- but once it gets up to the
GG> 50+ line procedures, ASM helps tremendously in both execution time and
GG> size. IE: Last graphics scroll routine worked on; approximately 150
GG> lines Pascal code, about 170 lines ASM code, execution times 25+ times
GG> faster.
I must agree with John Gohde on this. There is no need to resort to BASM
or assembler code in TP programs unless there is justifiable reason for it.
I define "justifiable reason" as being one of the following -
* The code is speed sensitive to the point where the use of assembler
is essential for that speed sensitive routine.
* Where its use will make a noticeable difference to the end user's
perception of the speed the program runs at.
* Where TP is unable to perform the defined task.
* When size of exe code is critical and use of BASM code reduces the
code size significantly.
* When I do not wish to use a particular unit (such as DOS) and BASM
allows me to easily create a replacement procedure or function from
that unit.
* When using assembler is the easiest method to use.
Too often we see code posted here that, using the above criteria, appears
to use BASM unnecessarily. When I see such code I tend to think the poster
is on an ego trip. :-)
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/17 20:24:20
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-17-92 06:44:09
From Trevor Carlsen
To Andreas Holtmann
Subject Text Files
AH> const lines = 1024;
AH> var myfile : array [1..lines] of string;
AH> file_handle : text;
AH> name = string;
AH> line : integer;
This would not even compile, let alone run. To enable compilation to be complet
d the value of lines would have to be reduced to 253 or less. (No structure
can exceed just under 64K in size and the total of global variables is limited
to just under 64K.)
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/17 20:24:20
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-17-92 07:01:25
From Trevor Carlsen
To Mike Copeland
Subject BLOCKWRITE QUESTION.
MC> ... (The EOF is written only at Close time, only at
MC> the end of the file.)
TP does not add an end-of-file character unless the programmer specifically
adds it. This is explained in detail in the manual under Read as regards reading
of text files. It would be easy to assume that TP adds an eof character to
files if using the read procedure. Examination of files created with TP by
an utility such as PCTools will show no eof character present. I do believe
however that some reference to this should be included in the section for
the close procedure.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/17 20:24:20
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-17-92 16:52:27
From Trevor Carlsen
To Greg Williams
Subject Re: Pascal Vs. C
GW> Hmm..... some compilers don't require an explicit EXPORT command (to
GW> declare their interfaced/public routines and variables. One such
GW> compiler is the JPI Modula-2... I don't use EXPORT usually, but it
GW> SHOULD be supported (as it's part of the language spec (I think?!))...
This message bears no relationship to your subject line and is not related
to the subject matter of this conference. Please take any further discussion
to netmail.
Trevor Carlsen
Moderator.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/17 20:24:21
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-17-92 08:06:53
From Dj Murdoch
To Kenneth Otto
Subject Re: Borland pascal 6.1?
KO> So, is Turbo Pascal 6.1 rumored to be on the way?
I haven't heard anything about TP 6.1, but Borland has said on Compuserve
that they plan to release a high end version of TP called "Borland Pascal"
sometime this year. It's supposed to support (include?) a DOS extender, so
you can write protected mode programs without Windows; if it's like Borland
C++, it'll also support Windows.
I've also seen somewhere that Borland plans eventually to produce an OS/2
version of TP, but probably not this year.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/18 11:26:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-17-92 08:10:37
From Dj Murdoch
To Mike Copeland
Subject Re: Pascal, The Language
JM>Do assemblers have user-defined data types?
MC> Certainly! When you consider how Pascal implements
MC> user-defined data types (it maps the hardware-defined data
MC> to its data types), Assembler can do the same, and more...
More like "the same, and less". Most assemblers don't do type checking beyond
the size of the argument; that's a lot less useful than Pascal's strong type
checking.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/18 11:26:05
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-17-92 08:14:02
From Dj Murdoch
To Steve Gabrilowitz
Subject Re: Delay patch
SG> OK, but I still think a better solution is to write your
SG> own delay routine that is not dependant on the speed of the machine.
I think the point is that that is quite difficult. If you want it to run
accurately on anything from a 4.77 MHz PC to a 1000 Mhz 786, you'll need to
do some fancy programming.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/18 11:26:06
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-17-92 08:16:14
From Dj Murdoch
To J J Marquez
Subject Re: Are you listening... ?
JJ> Wanna know what my greatest fear is ? That C++ will add
JJ> it in first, causing me to have to learn C.... AAAaaaaaaiiiieeeeee!
I'm pretty sure that most numerical libraries for C++ add it in. There are
some advantages to being able to redefine operators.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/18 11:26:06
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-18-92 06:38:44
From Trevor Carlsen
To Dale Frakes
Subject Variable # parameters
DF> Does anyone out there know how to write a pascal (TP 6.0) function or
DF> procedure that accepts a variable number of parameters. I assume this
DF> is possible, since Write, Writeln, Read, Readln, Concat, etc all
DF> accept variable number of parameters, and they are written in Pascal.
DF> Has someone who has seen the source for the Run Time Libraries know
DF> how this is done? Again, I would assume that if someone can compile
DF> the RTL, it can be done within the Pascal environment.
Strictly speaking it cannot be done. The procedures you refer to that *appear*
to do that are actually changed by the compiler to effectively be *several*
procedures in the actual exe file.
You could however create a procedure that gives the effect of a variable number
of parameters by passing a single parameter which is a linked list. I've
never found that it is necessary to do this in the time I have been programming.
If you want to emulate the write/writeln/read/readln procedures at some time,
it is easy to set up a TFDD (text file device driver) to do so. The next
issue of PNL (#11) may have an article explaining this very useful technique.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/18 18:50:18
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-18-92 13:35:36
From Trevor Carlsen
To Frank Livaudais
Subject Text Files (1 of 3)
FL> I want to read in text files bt make them binary so that you cant
FL> 'type' them from dos.
I think that the fastest and easiest way of doing this would be to use some
form of very simple encryption. Here is a program to encrypt or decrypt a
file - any file - using a simple password as your key and a key file that
you have on your system that is not subject to ever being altered. This approach
s being totally secure as it is almost a "one time pad" method.
It is tested as far as compilation is concerned and also briefly for valid
execution. It appears to work Ok.
{$A+,B-,D-,E+,F-,G+,I+,L-,N-,O-,R-,S-,V-,X+}
{$M 4048,0,131040}
program encrypt;
{ Author Trevor J Carlsen - released into the public domain 1992 }
{ PO Box 568 }
{ Port Hedland }
{ Western Australia 6721 }
{ Voice +61 91 73 2026 Data +61 91 73 2569 }
{ FidoNet 3:690/644 }
{ Syntax: encrypt /p=Password /k=Keyfile /f=File }
{ Example - }
{ encrypt /p=billbloggs /k=c:\command.com /f=p:\prog\anyfile.pas }
{ Password can be any alpha-numeric sequence of AT LEAST four }
{ characters. }
{ Keyfile is the full path of any file on the system that this }
{ program runs on. This file, preferably a large one, must not }
{ be subject to changes. This is critical as it is used as a }
{ pseudo "one time pad" style key and the slightest change will }
{ render decryption invalid. }
{ File is the full path of the file to be encrypted or decrypted.}
{ Notes: Running Encrypt a second time with exactly the same parameters }
{ decrypts an encrypted file. For total security the keyfile }
{ can be stored separately on a floppy. Without this keyfile or }
{ knowledge of its contents it is IMPOSSIBLE to decrypt the }
{ encrypted file. }
{ Parameters are case insensitive and may be in any order and }
{ may not contain any dos separator characters. }
const
BufferSize = 65520;
Renamed : boolean = false;
type
buffer_ = array[0..BufferSize - 1] of byte;
buffptr = ^buffer_;
str80 = string[80];
var
OldExitProc : pointer;
KeyFile,
OldFile,
NewFile : file;
KeyBuffer,
Buffer : buffptr;
KeyFileSize,
EncFileSize : longint;
Password,
KFName,
FFName : str80;
continued next message.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/18 18:50:19
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-18-92 13:38:59
From Trevor Carlsen
To Frank Livaudais
Subject Text Files (2 of 3)
... continued from previous message
procedure Hash(p : pointer; numb : byte; var result: longint);
{ When originally called numb must be equal to sizeof }
{ whatever p is pointing at. If that is a string numb }
{ should be equal to length(the_string) and p should be }
{ ptr(seg(the_string),ofs(the_string)+1) }
var
temp,
w : longint;
x : byte;
begin
temp := longint(p^); RandSeed := temp;
for x := 0 to (numb - 4) do begin
w := random(maxint) * random(maxint) * random(maxint);
temp := ((temp shr random(16)) shl random(16)) +
w + MemL[seg(p^):ofs(p^)+x];
end;
result := result xor temp;
end; { Hash }
procedure NewExitProc; far;
{ Does the "housekeeping" necessary on program termination }
var code : integer;
begin
ExitProc := OldExitProc; { Reset exit procedure pointer to original }
case ExitCode of
0: writeln('Successfully encrypted or decrypted ',FFName);
1: begin
writeln('This program requires 3 parameters -');
writeln(' /pPassword');
writeln(' /kKeyFile (full path and name)');
write (' /fFile (The full path and name of the file');
writeln(' to be processed)');
writeln;
write ('These parameters can be in any order, are case,');
writeln(' insensitive, and may not contain any spaces.');
end;
2: writeln('Could not find key file');
3: writeln('Could not rename and/or open original file');
4: writeln('Could not create encrypted file');
5: writeln('I/O error during processing - could not complete');
6: writeln('Insufficient memory available');
7: begin
writeln('Key file is too small - aborted');
writeln;
writeln(' Key File must be at least as large as the buffer size ');
write (' or the size of the file to be encrypted, whatever is the');
writeln(' smaller.');
end;
8: writeln('Password must consist of at least 4 characters');
else { any other error }
writeln('Aborted with error ',ExitCode);
end; { case }
if Renamed and (ExitCode <> 0) then
writeln(#7'WARNING: Original file''s name is now TEMP.$$$');
{$I-}
close(KeyFile); Code := IOResult;
close(NewFile); Code := IOResult;
close(OldFile); Code := IOResult;
if ExitCode = 0 then
Erase(OldFile); Code := IOResult;
{$I+}
end; { NewExitProc }
function Str2UpCase(var S: string): string;
{ Converts a string S to upper case. Valid for English. }
var
x : byte;
begin
Str2UpCase[0] := S[0];
for x := 1 to length(S) do
Str2UpCase[x] := UpCase(S[x]);
end; { Str2UpCase }
continued in next message...
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/18 18:50:19
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-18-92 13:42:39
From Trevor Carlsen
To Frank Livaudais
Subject Text Files (3 of 3)
... continued from previous message
procedure Initialise;
var
CommandLine : string;
FPos,FLen,
KPos,KLen,
PPos,PLen : byte;
procedure AllocateMemory(var p: buffptr; size: longint);
begin
if size < BufferSize then begin
if MaxAvail < size then halt(6);
GetMem(p,size);
end
else begin
if MaxAvail < BufferSize then halt(6);
new(p);
end;
end; { AllocateMemory }
begin
FillChar(OldExitProc,404,0); { Initialise all global variables }
FillChar(Password,243,32);
ExitProc := @NewExitProc; { Set up new exit procedure }
if ParamCount <> 3 then halt(1);
CommandLine := string(ptr(PrefixSeg,$80)^)+' '; { Add trailing space }
CommandLine := Str2UpCase(CommandLine); { Convert to upper case }
PPos := pos('/P=',CommandLine); { Find password parameter }
KPos := pos('/K=',CommandLine); { Find keyfile parameter }
FPos := pos('/F=',CommandLine); { Find filename for encryption}
if (PPos = 0) or (KPos = 0) or (FPos = 0) then { Parameters wrong }
Halt(1);
FFName := copy(CommandLine,FPos+3,80);
FFName[0] := chr(pos(' ',FFName)-1); { Correct string length }
KFName := copy(CommandLine,KPos+3,80);
KFName[0] := chr(pos(' ',KFName)-1);
Password := copy(CommandLine,PPos+3,80);
Password[0] := chr(pos(' ',Password)-1);
if length(Password) < 4 then halt(8);
{ Create a random seed value based on the password }
Hash(ptr(seg(Password),ofs(Password)+1),length(Password),RandSeed);
assign(OldFile,FFName);
{$I-}
rename(OldFile,'TEMP.$$$'); { Rename the file to be encrypted }
if IOResult <> 0 then halt(3) else renamed := true;
assign(OldFile,'TEMP.$$$');
reset(OldFile,1);
if IOResult <> 0 then halt(3);
assign(NewFile,FFName);
rewrite(NewFile,1);
if IOResult <> 0 then halt(4);
assign(KeyFile,KFName);
reset(KeyFile,1);
if IOResult <> 0 then halt(2);
EncFileSize := FileSize(OldFile);
KeyFileSize := FileSize(KeyFile);
if KeyFileSize > EncFileSize then KeyFileSize := EncFileSize;
if IOResult <> 0 then halt(5);
{$I+}
if (KeyFileSize < BufferSize) and (KeyFileSize < EncFileSize) then
halt(7);
AllocateMemory(buffer,EncFileSize);
AllocateMemory(KeyBuffer,KeyFileSize);
end; { Initialise }
procedure Main;
var
BytesRead : word;
finished : boolean;
procedure CodeBuffer(number: word);
{ This is the actual encryption/decryption engine }
var x : word;
begin
for x := 0 to number - 1 do
buffer^[x] := buffer^[x] xor KeyBuffer^[x] xor Random(256);
end; { CodeBuffer }
begin
{$I-}
finished := false;
repeat
BlockRead(OldFile,buffer^,BufferSize,BytesRead);
if (FilePos(KeyFile) + BytesRead) > KeyFileSize then
seek(KeyFile,0);
BlockRead(KeyFile,KeyBuffer^,BytesRead,BytesRead);
CodeBuffer(BytesRead);
finished := BytesRead < BufferSize;
BlockWrite(NewFile,buffer^,BytesRead);
if IOResult <> then halt(5);
until finished;
{$I+}
end; { Main }
begin
Initialise;
Main;
end.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/18 18:50:19
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-15-92 23:34:00
From Terry Hughes
To Joshua Kersey @ 930/22
Subject ExecSwap
JK@9>I need help using ExecSwap, can anyone help me out? This
JK@9>little source does work, it executes it, but ARJ has no
JK@9>memory to work with at all, what's catching my shirttail
JK@9>here?
JK@9>In the ExecWSwp DOcs it says to use FreePtr^, but in TP,
JK@9>it's an "Unknown Identifier" and haven't stooped to buy
JK@P>TPRO yet...
FreePtr has nothing to do with TPRO. FreePtr is a system
variable used in the heap managment in versions 4 through 5.5 of
Turbo Pascal.
The EXECSWAP documentation explains three possible purposes for
LastToSave: 1) save no heap, 2) save all heap but free list and
3) save all heap and free list. The third condition is the one
that requires the expression you were trying to use:
Ptr(Seg(FreePtr^)+$1000, 0). Under Turbo Pascal 6.0, which you
apparently are using, this expression is no longer necessary
since the free list is stored within the heap itself. So, case 2
is no longer applicable and case 3 becomes simply "HeapPtr".
In case that wasn't clear, just pass HeapPtr for LastToSave and
all will be well:
if InitExecSwap(HeapPtr, 'EXECDEMO.$$$') then
...
-Terry
* OLX 2.2 * TurboPower Software (voice 719-260-6641)
--- Maximus 2.01wb
* Origin: The Programmers Playhouse (1:128/60)
* Tossed by SFToss v1.00b on 92/03/19 04:34:20
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-17-92 15:46:02
From Terry Hughes
To Rob Kittredge
Subject C++ products
RK> What was it that convinced you that TP was "better"
RK> than C++ in particular?
Just about everything. <g>
I can't compare the environments since I don't use either IDE.
To the languages themselves, TP is a much leaner/cleaner
language than C++. Bucking the trend here, I hope Borland keeps
TP simple and avoids the temptation to add all the myriad
features (gee gaws?) of C++ to TP. To me, TP's simplicity is
what makes it such a pleasure to work with and what can make a
TP programmer more productive than a C++ programmer.
Beyond that, the biggest issues were compilation capacity,
compilation speed, linking speed and ease of smart linking (in
C++, smart linking requires putting every smart-linkable
procedure in its own OBJ file). TP wins hands down in all of
those categories (although BC++ 3.0 caught up in compilation
capacity).
RK> P.S. did you happen to take a look at my mods to OPRO for
RK>TP's MAKEHELP to support those "+1" constants?
We decided not to merge those changes into the production
MAKEHELP since it's not a request we've ever heard before.
However, we've kept your version of MAKEHELP around should the
need ever arise. Thanks for sending it.
-Terry
* OLX 2.2 * TurboPower Software (voice 719-260-6641)
--- Maximus 2.01wb
* Origin: The Programmers Playhouse (1:128/60)
* Tossed by SFToss v1.00b on 92/03/19 04:34:20
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-17-92 15:47:04
From Terry Hughes
To Joshua Kersey @ 930/22
Subject Re: Execute With Swap
JK@9>No, it wasn't posted, but the code's kinda long, I'll post
JK@9>it, if it's agreeable to Terry Hughes, it's part ASM and
JK@9>part Pascal..
It's OK by me (since it's PD code) but instead why don't I just
mention our BBS number here (719-260-9726). That way, Kevin can
come get it if he wants it and we'll avoid generating the
lengthy messages that the code would require.
-Terry
* OLX 2.2 * TurboPower Software (voice 719-260-6641)
--- Maximus 2.01wb
* Origin: The Programmers Playhouse (1:128/60)
* Tossed by SFToss v1.00b on 92/03/19 04:34:21
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-18-92 08:39:06
From Terry Hughes
To Jud Mccranie
Subject B-tree filer
JM>First, a slight misprint in the BTree manual, page 64, row 12,
JM>"NextKey" should be "BTNextKey".
Thanks. We'll fix that in the next printing.
JM>up for editing. Then if I press pageDown (for next record), I use
JM>the NextPrev proc, but the first (only) time I do that it always calls
JM>up the very first record with the matching key, which is not generally
JM>the previous record.
BTNextKey has two distinct behaviors. If the internal
"sequential pointer" is valid then BTNextKey ignores the passed
parameters and returns the next key in sequence. If the internal
sequential pointer is invalid then BTNextKey uses the passed
parameters to reposition the sequential pointer. Note that this
second behavior only occurs if the SearchForSequential option
has been turned on (as it is by default).
Based on your description, I would guess that
SearchForSequential is on and the internal sequential pointer
is invalid or was never set to begin with. A quick way to test
this theory would be to turn SearchForSequential off -- in that
case your call to NextPrevRecord should return 10255 when trying
to get the next record and 10265 when trying to get the previous
record.
You might want to look at the reference section for BTNextKey
for a more complete discussion of this issue.
-Terry
* OLX 2.2 * TurboPower Software (voice 719-260-6641)
--- Maximus 2.01wb
* Origin: The Programmers Playhouse (1:128/60)
* Tossed by SFToss v1.00b on 92/03/19 04:34:21
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-18-92 08:47:08
From Terry Hughes
To David G. Edwards
Subject Why I Like Tp 5.5 Ide (c
DGE>In a message of <10 Mar 92 13:54:43>, Stephan Patterson (1:240/507.3)
writes
DGE> >Like it or not,
DGE> >SAA/CUA-compliant user interfaces are the way of the future. Most people
DGE> >prefer them, by far, to the older style interface a la OPRO.
DGE>I thought OPRO could be used to design SAA/CUA user-interfaces. Am I off?
You are correct. OPRO can be used to build CUA compliant
interfaces by virtue of its flexibility. And OPRO has had
specific support for dialog boxes (with list boxes, radio
buttons, check boxes, etc.) since version 1.03.
-Terry
* OLX 2.2 * TurboPower Software (voice 719-260-6641)
--- Maximus 2.01wb
* Origin: The Programmers Playhouse (1:128/60)
* Tossed by SFToss v1.00b on 92/03/19 04:34:21
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-18-92 09:03:10
From Terry Hughes
To Dj Murdoch
Subject Re: Binary Tree Linked L
DM> > Actually B-Trees are more effecient than Binary tress and
DM> DF>
DM> DF> I thought the B in B-tree stood for Binary. What is the
DM> DF> difference between a b-tree and a binary tree? (Just a
DM> DF> basic explanation, I don't want source and such).
DM>B is for Balanced - to the extent possible, every node has
DM>the same number of subnodes. A binary tree can be so
DM>imbalanced as to be nearly a linked list, if new nodes are
DM>always added on the right, for instance.
In the circles that I travel (database toolbox vendors and
programmers) B-Tree is generally understood to mean Bayer-Tree
-- Bayer being one of the inventors of this particular
structure. It's different from a binary tree in that each node
contains pointers to many subnodes, rather than just left/right
subnodes and every node must be at least half-full. I believe a
Bayer-Tree implies balancing as well but I don't have my
reference here right now to check.
-Terry
* OLX 2.2 * TurboPower Software (voice 719-260-6641)
--- Maximus 2.01wb
* Origin: The Programmers Playhouse (1:128/60)
* Tossed by SFToss v1.00b on 92/03/19 04:34:22
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-17-92 23:34:10
From Dj Murdoch
To All
Subject Yet another use for streams
My streams unit keeps growing. The latest addition is a suite of procedures
that let you use any stream for your overlay buffer. You say
OvrInit('whatever.ovr');
OvrInitStream(AStream);
and it will copy the various overlay segments out to the stream, so that future
overlay loads come from there. If you have an XMS stream, you can have your
overlays buffered in XMS. If you have a ramdisk, you can buffer just your
overlays there, without having to copy the whole file over before you run it.
One nice feature is that you can mix and match: if you have just a bit of
EMS, you can use it for a few overlays, put some more in XMS, a few more on
a ramdisk, and leave the rest on your regular disk. You can change the allocati
n dynamically, too.
Streams are a lot of fun.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/19 12:33:59
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 06:14:55
From Trevor Carlsen
To Dj Murdoch
Subject Re: Tp 6.0 Ide
TC> That is available in any good programming editor - not just the
TC> IDE.
DM>
DM> Read what he wrote - he's talking run-time errors, not compile errors.
DM> To get those from other editors you generally have to recompile with
DM> the /F option, and retype the address.
So was I. (Referring to RUN-time errors.)
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/20 04:32:24
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 06:27:46
From Trevor Carlsen
To Gary Elfert
Subject Re: Reading from a text f
GE> Could you post an example of how to search for certain text within a
GE> text file? Thanks.
Download PNL010.* from a BBS near you. It contains an example of a Boyer-Moore
search.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/20 04:32:24
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 06:33:45
From Trevor Carlsen
To Mark Dixon
Subject Re: Hacking the Network
Take this thread somewhere else. The subject of this conference is Pascal.
Trevor Carlsen
Moderator
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/20 04:32:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 06:52:09
From Trevor Carlsen
To Tim Bogel
Subject virus
In a message in the PASCAL conference 15 March 92
and addressed to All, Tim Bogel (1:120/320) writes:
TB> Does anyone know how to make a virus through pascal, if it is even
TB> possible, and if so how can I go about making one?
Anyone responding positively to this request can expect to be excommunicated
from this conference with no warning given. Bogel (and his sysop) have been
netmailed.
Trevor Carlsen
Moderator.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/20 04:32:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 07:08:38
From Trevor Carlsen
To ANDREW BROUGHTON
Subject Re: Variable-Length Records
AB> The database already exists, and will be updated maybe only once a
AB> year or so, so the updating procedure does not have to be fast or
AB> careful. The main problem is, the database is about 4 megs, containing
AB> more than 250,000 SINGLE FIELD records. Now to create an index file is
AB> the usual way, but the index file would be as big as the database
AB> file!...
Perhaps you misunderstand the function of the suggested index file. All the
index file needs to do is give you the offset of each record in the file.
As the file is about 4MB, the index file can be as small as 3 bytes per record.
(4 bytes if you don't feel like writing routines for a 3 byte integer type.)
Therefore it need not exceed 750K for 250K records and whilst that is still
a 18% increase in storage space requirements, it may well be worth it.
AB> ... The original database is already sorted...
An index file is certainly the fastest and IMHO the best way to solve the
problem.
You provide no indication of what information the data base contains other
than it being single field. If you choose a 4 byte index record the 10 msbits
would be available for some kind of information that might further reduce
the need to acces the main file.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/20 04:32:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 07:27:58
From Trevor Carlsen
To Mark Farnan
Subject Btrieve Programmers
MF> Not yet, but I would like to learn about it, Have you or anybody else
MF> got some good source/reference material regarding FAST database
MF> programming ??, my problem is i need a database where a record is NOT
MF> a set length, and it also may grow but up to 200 bytes per record at
MF> anytime. I DO NOT want to allcocate this wasted space when i start
MF> because 200 bytes x 4000 records is ALOT of room, and only some
MF> records may grow, etc, etc.
Have you got the B-File package from Turbo Power?
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/20 04:32:25
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 07:29:35
From Trevor Carlsen
To Jud Mccranie
Subject Re: Why I Like Tp 5.5 Ide More Than 6.0
JM> I sometimes use $IFDEF test, but usually I want to test at that
JM> location only temporarily. I need to remember to remove it.
Why? That is the whole point of compiler conditionals! They allow you to
leave these extras there without them affecting your executable by just changing
one define right at the start of your code.
Even if you wish to remove them at some later time they make things easier.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/20 04:32:26
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 07:33:58
From Trevor Carlsen
To Jud Mccranie
Subject Re: hiya
JM> randomize doesn't produce a more random number - it just keeps it
JM> from generating the same sequence each time.
I realise that the following might be construed as taking pedanticism to extreme
, and I'm sure you know what Randomize does, but it doesn't really produce
a different sequence of numbers at all, just ensures a different starting
point in a "master" sequence which is reasonably unpredictable due to the
way it seeds RandSeed *providing* it is not repeatedly called within the same
clock tick.
Now the reason for my pendantics is because some may have interpreted your
statement to mean that use of the Randomize procedure will ensure a seemingly
different entry point for the sequence of numbers each time it used. Because
of the manner in which it obtains the value it assigns RandSeed, this is only
true if different calls do not occur within the same clock tick. It also
means there are only 1,573,040 possible starting numbers each day even though
Borland's algorithm has a much longer "period".
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/20 04:32:26
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 18:23:39
From Trevor Carlsen
To Jim Starke
Subject Input Routine (1 of 3)
JS> The only thing I can think of is making a totally new input
JS> routine from scratch that will check for the back space, cursor
JS> keys, home key, insert key, end key, etc. and re-invent the
JS> wheel in other words.
JS> Can anyone enlighten me with some code so I don't have to
JS> re-invent the wheel?
Here is a unit that should do what you want...
unit keyinput;
{ Author Trevor J Carlsen - released into the public domain 1991 }
{ PO Box 568 }
{ Port Hedland }
{ Western Australia 6721 }
{ Voice +61 91 73 2026 Data +61 91 73 2569 }
{ FidoNet 3:690/644 }
{ This unit is designed to permit controlled input into a pre-determined }
{ field size. It also provides some handy associated procedures and }
{ functions and constants. }
interface
uses crt;
const
F1 = $3b00; ShF1 = $5400; CtrlF1 = $5e00; AltF1 = $6800;
F2 = $3c00; ShF2 = $5500; CtrlF2 = $5f00; AltF2 = $6900;
F3 = $3d00; ShF3 = $5600; CtrlF3 = $6000; AltF3 = $6a00;
F4 = $3e00; ShF4 = $5700; CtrlF4 = $6100; AltF4 = $6b00;
F5 = $3f00; ShF5 = $5800; CtrlF5 = $6200; AltF5 = $6c00;
F6 = $4000; ShF6 = $5900; CtrlF6 = $6300; AltF6 = $6d00;
F7 = $4100; ShF7 = $5a00; CtrlF7 = $6400; AltF7 = $6e00;
F8 = $4200; ShF8 = $5b00; CtrlF8 = $6500; AltF8 = $6f00;
F9 = $4300; ShF9 = $5c00; CtrlF9 = $6600; AltF9 = $7000;
F10 = $4400; ShF10 = $5d00; CtrlF10 = $6700; AltF10 = $7100;
BackSpace = $0e08; CtrlBackSpace = $0e7f;
Tab = $0f09; Tab_left = $0f00;
Enter = $1c0d; CtrlEnter = $1c0a;
InsertKey = $5200; DeleteKey = $5300;
Home = $4700; CtrlHome = $7700;
Endkey = $4f00; CtrlEnd = $7500;
PageUp = $4900; CtrlPageUp = $8400;
PageDn = $5100; CtrlPageDown = $7600;
UpArrow = $4800; DownArrow = $5000;
LeftArrow = $4b00; CtrlLeftArrow = $7300;
RightArrow = $4d00; CtrlRightArrow= $7400;
Escape = $011b;
type
CursorState = (Off, On, Normal, Block);
const
InsertOn : boolean = false;
procedure Beep(freq,len: word);
function CursorStatus: CursorState;
procedure Cursor(Action: CursorState);
procedure NormalCursor;
procedure HiddenCursor;
procedure BlockCursor;
function ReadStr(width : word;
prompt : string;
attr : byte;
s : string) : string;
implementation
var
OriginalStatus : CursorState;
OldExitProc : pointer;
procedure Beep(freq,len : word);
{ Beeps the speaker for len thousandths of a second }
begin
Sound(freq);
delay(len);
NoSound;
end; { Beep }
function CursorStatus: CursorState;
var
bottom: byte absolute $40:$60;
top : byte absolute $40:$61;
x : shortint;
begin
x := bottom - top;
if x < 0 then
CursorStatus := Off
else if x = 1 then
CursorStatus := Normal
else if x > 1 then
CursorStatus := Block
else CursorStatus := On;
end; { CursorStatus }
Continued next message...
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/20 04:32:26
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 18:21:05
From Trevor Carlsen
To Jim Starke
Subject Input Routine (2 of 3)
... continued from previous message.
procedure Cursor(Action : CursorState);
{ Turn the cursor on/off or make it a block}
procedure ChangeCursor(top,bottom : byte);
begin
asm
mov ah, $01
mov ch, top
mov cl, bottom
int $10
end;
end; { ChangeCursor}
begin
case action of
On : if LastMode = Mono then
ChangeCursor($0C,$0C)
else
ChangeCursor($06,$06);
Normal : if LastMode = Mono then
ChangeCursor($0B,$0C)
else
ChangeCursor($06,$07);
Off : ChangeCursor($20,$00);
Block : if LastMode = Mono then
ChangeCursor($02,$0C)
else
ChangeCursor($02,$07);
end; { case}
end; { ChangeCursor}
procedure NormalCursor;
begin
Cursor(On);
end; { NormalCursor }
procedure HiddenCursor;
begin
Cursor(Off);
end; { HiddenCursor }
procedure BlockCursor;
begin
Cursor(Block);
end; { BlockCursor }
function KeyWord : word; assembler;
{ Returns a word value where the msb is the scan code of a keypress }
{ and the lsb is the asciiz value of the key. }
asm
mov ax,0
int 16h
end; { KeyWord }
Continued next message ...
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/20 04:32:27
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 18:22:33
From Trevor Carlsen
To Jim Starke
Subject Input Routine (3 of 3)
...continued from previous message.
function ReadStr(width : word;
prompt : string;
attr : byte;
s : string) : string;
{ Editing keys are - }
{ DeleteKey - DeleteKeys character at the cursor. }
{ LeftArrow - Nondestructive move cursor to the left. }
{ RightArrow - Nondestructive move cursor to the right. }
{ End - Move cursor to end of input string. }
{ Home - Move cursor to start of input string. }
{ Backspace - DeleteKeys character to the left of cursor. }
{ escape - Aborts routine which then returns just an }
{ escape character - regardless of what }
{ characters were previously entered. }
{ return/enter - Leaves routine with string returned. }
{ Width = The width of the input field. Once input reaches the width }
{ required, no further characters are accepted. }
{ prompt= A prompt will be displayed in the current attribute. If no }
{ prompt is required pass a nul string. }
{ attr = The input field will be displayed in attr colour. }
{ s = s will be displayed in the input field and the cursor will }
{ be positioned at the end of the s string. }
{ Example: }
{ st := ReadStr(20,'Enter Name: ',LtGrayOnBlue,st); }
{ ( st MUST be initialised in the above example before the call. ) }
const
space = #32;
var
xpos, ypos,
stpos,OldAttr : byte;
len : byte absolute s;
finished : boolean;
key : word;
ch : char absolute key;
procedure WriteField;
var x : byte;
begin
GotoXY(xpos,ypos);
for x := 1 to width do
write(space);
GotoXY(xpos,ypos);
end; { WriteField }
procedure DeleteChar;
begin
Delete(s,stpos,1);
s := s + space;
gotoXY(xpos,ypos);
write(s);
dec(len);
end; { DeleteChar }
procedure AddChar;
{ Checks that it is valid to insert or add a character to input str }
begin
if InsertOn then begin
if (len < width) then begin
move(s[stpos],s[succ(stpos)],width-pred(stpos));
inc(len);
s[stpos] := ch;
inc(stpos);
end
else beep(450,15);
end else begin
if stpos <= width then begin
s[stpos] := ch;
if stpos > len then
inc(len);
inc(stpos);
end else beep(450,15);
end;
end; { AddChar }
begin
finished := false;
OldAttr := TextAttr;
write(prompt);
TextAttr := attr;
xpos := WhereX;
ypos := WhereY;
WriteField;
stpos := succ(len);
repeat
GotoXY(xpos,ypos);
write(s);
GotoXY(xpos + pred(stpos),ypos);
if InsertOn then
Cursor(Block)
else
Cursor(Normal);
key := KeyWord;
case key of
InsertKey : InsertOn := not InsertOn;
DeleteKey : if (len > 0) and (stpos > 0) then
DeleteChar;
Enter : begin
ReadStr := s;
finished := true;
end;
BackSpace : if stpos > 1 then begin
dec(stpos);
DeleteChar;
end
else beep(450,15);
Escape : begin
finished := true;
ReadStr := ch;
WriteField;
len := 0;
end;
LeftArrow : if stpos > 1 then dec(stpos);
RightArrow : if stpos <= len then inc(stpos);
Home : stpos := 1;
EndKey : stpos := succ(len);
else begin case lo(key) of
32..255: AddChar
else beep(450,15);
end; { case lo(key) of }
end; { else }
end; { case key of }
until finished;
TextAttr := OldAttr;
writeln;
end; { ReadStr }
procedure KbdExitProc; far;
begin
ExitProc := OldExitProc;
Cursor(OriginalStatus);
end; { KbdExitProc }
begin
{ Set up an exit procedure to ensure that the cursor is restored }
OldExitProc := ExitProc;
OriginalStatus := CursorStatus;
end.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/20 04:32:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 19:37:33
From Trevor Carlsen
To James Chambers
Subject Text Viewer (1 of 3)
JC> Does anyone know where I can get the source for a
JC> simple text viewer?
JC> I just need to display one 66 line page on screen
JC> and allow scrolling.
I'm not sure how you intend to display 66 lines on screen. However here is
a text viewer that will allow you to view a text file with scrolling capabilitie
.
{$A+,B-,D-,E+,F-,I+,L-,N-,O-,R+,S-,V-}
{$M 4048,65536,655360}
program Readtext;
{ Author Trevor J Carlsen - released into the public domain 1991 }
{ PO Box 568 }
{ Port Hedland }
{ Western Australia 6721 }
{ Voice +61 91 73 2026 Data +61 91 73 2569 }
{ FidoNet 3:690/644 }
{ This example programs displays a text file using simple word wrap. The }
{ cursor keys are used to page forward or backwards by page or by line. }
{ The program makes some important assumptions. The main one is that no }
{ line in the file will ever exceed 255 characters in length. To get }
{ around this restriction the ReadTxtLine function would need to be }
{ rewritten. }
{ The other major restriction is that files exceeding a size able to be }
{ totally placed in RAM cannot be viewed. }
{.$DEFINE TurboPower (Remove the period if you have Turbo Power's TPro) }
uses
{$IFDEF TurboPower }
tpcrt,
colordef;
{$ELSE}
crt;
{$ENDIF}
const
{$IFNDEF TurboPower }
BlackOnLtGray = $70; LtGrayOnBlue = $17;
{$ENDIF}
LineLength = 79; MaxLines = 6000;
ScreenLines = 22; escape = $011b;
Home = $4700; _end = $4f00;
upArrow = $4800; downArrow = $5000;
PageUp = $4900; PageDown = $5100;
type
LineStr = string[Linelength];
StrPtr = ^LineStr;
var
TxtFile : text;
Lines : array[1..MaxLines] of StrPtr;
NumberLines: 1..MaxLines+1;
CurrentLine: 1..MaxLines+1-ScreenLines;
st : string;
finished : boolean;
OldExitProc: pointer;
TxtBuffer : array[0..16383] of byte;
function LastPos(ch : char; S : string): byte;
{ Returns the last position of ch in S or zero if ch not in S }
var
x : word;
len : byte absolute S;
begin
x := succ(len);
repeat
dec(x);
until (x = 0) or (S[x] = ch);
LastPos := x;
end; { LastPos }
continued in next message ...
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/20 04:32:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 19:41:56
From Trevor Carlsen
To James Chambers
Subject Text Viewer (2 of 3)
... continued from previous message.
function Wrap(var S,CarryOver: string): string;
{ Returns a string of maximum length Linelength from S. Any additional }
{ characters remaining are placed into CarryOver. }
const
space = #32;
var
temp : string;
LastSpace : byte;
len : byte absolute S;
begin
FillChar(temp,sizeof(temp),32);
temp := S; CarryOver := ''; wrap := temp;
if length(temp) > LineLength then begin
LastSpace := LastPos(space,copy(temp,1,LineLength+1));
if LastSpace <> 0 then begin
Wrap[0] := chr(LastSpace - 1);
CarryOver := copy(temp,LastSpace + 1, 255)
end { if LastSpace... }
else begin
Wrap[0] := chr(len);
CarryOver := copy(temp,len,255);
end; { else }
end; { if (length(S))...}
end; { Wrap }
function ReadTxtLine(var f: text; L: byte): string;
var
temp : string;
len : byte absolute temp;
done : boolean;
begin
len := 0; done := false;
{$I-}
while not eoln(f) do begin
read(f,temp);
if IOResult <> 0 then begin
writeln('Error reading file - aborted');
halt;
end;
end; { while }
if eoln(f) then readln(f);
ReadTxtLine := st + Wrap(temp,st);
finished := eof(f);
end; { ReadTxtLine }
procedure ReadTxtFile(var f: text);
var
x : word;
begin
st := '';
NumberLines := 1;
repeat
if NumberLines > MaxLines then begin
writeln('File too big');
halt;
end;
if (MaxAvail >= Sizeof(LineStr)) then
new(Lines[NumberLines])
else begin
writeln('Insufficient memory');
halt;
end;
FillChar(Lines[NumberLines]^,LineLength+1,32);
if length(st) > LineLength then
Lines[NumberLines]^ := wrap(st,st)
else if length(st) <> 0 then begin
Lines[NumberLines]^ := st;
st := '';
end else
Lines[NumberLines]^ := ReadTxtLine(f,LineLength+1);
Lines[NumberLines]^[0] := chr(LineLength);
if not finished then
inc(NumberLines);
until finished;
end; { ReadTxtFile }
procedure DisplayScreen(line: word);
var
x : byte;
begin
GotoXY(1,1);
for x := 1 to ScreenLines - 1 do
writeln(Lines[x-1+line]^);
write(Lines[x+line]^)
end;
procedure PreviousPage;
begin
if CurrentLine > ScreenLines then
dec(CurrentLine,ScreenLines-1)
else
CurrentLine := 1;
end; { PreviousPage }
continued in next message ...
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/20 04:32:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 19:44:03
From Trevor Carlsen
To James Chambers
Subject Text Viewer (3 of 3)
... continued from previous message.
procedure NextPage;
begin
if CurrentLine < (succ(NumberLines) - ScreenLines * 2) then
inc(CurrentLine,ScreenLines-1)
else CurrentLine := succ(NumberLines) - ScreenLines;
end; { NextPage }
procedure PreviousLine;
begin
if CurrentLine > 1 then dec(CurrentLine)
else CurrentLine := 1;
end; { PreviousLine }
procedure NextLine;
begin
if CurrentLine < (succ(NumberLines) - ScreenLines) then
inc(CurrentLine)
else CurrentLine := succ(NumberLines) - ScreenLines;
end; { NextLine }
procedure StartOfFile;
begin
CurrentLine := 1;
end; { StartOfFile }
procedure EndOfFile;
begin
CurrentLine := succ(NumberLines) - ScreenLines;
end; { EndOfFile }
procedure DisplayFile;
function KeyWord : word; assembler;
asm
mov ah,0
int 16h
end;
begin
DisplayScreen(CurrentLine);
repeat
case KeyWord of
PageUp : PreviousPage;
PageDown : NextPage;
UpArrow : PreviousLine;
DownArrow : NextLine;
Home : StartOfFile;
_End : EndOfFile;
Escape : halt;
end; { case }
DisplayScreen(CurrentLine);
until false;
end; { DisplayFile }
{$IFDEF TurboPower}
procedure NewExitProc;far;
begin
ExitProc := OldExitProc;
NormalCursor;
end;
{$ENDIF}
procedure Initialise;
begin
CurrentLine := 1;
if ParamCount <> 1 then begin
writeln('No file name parameter');
halt;
end;
assign(TxtFile,Paramstr(1));
{$I-} reset(TxtFile);
if IOResult <> 0 then begin
writeln('Unable to open ',Paramstr(1));
halt;
end;
SetTextBuf(TxtFile,TxtBuffer);
Window(1,23,80,25);
TextAttr := BlackOnLtGray;
clrscr;
writeln
(' Next Page = [PageDown] Previous Page = [PageUp]');
writeln
(' Next Line = [DownArrow] Previous Line = [UpArrow]');
write
(' Start of File = [Home] End of File = [End] Quit = [Escape]');
Window(1,1,80,22);
TextAttr := LtGrayOnBlue;
clrscr;
{$IFDEF TurboPower}
HiddenCursor;
OldExitProc := ExitProc;
ExitProc := @NewExitProc;
{$ENDIF}
end;
begin
Initialise;
ReadTxtFile(TxtFile);
DisplayFile;
end.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/20 04:32:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-18-92 19:47:00
From Norbert Igl
To Chris Elris
Subject my bed
> SL> tied to the bed and lick you all over. i then would move down to
> SL> and suck it hard.....
> great babe, your bed or mine?!?!
?????? ..... hmmmmm (:-))
---
* Origin: Let's talk about hex, baby.... (2:241/5300.3)
* Tossed by SFToss v1.00b on 92/03/20 11:33:04
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-18-92 17:28:17
From Dj Murdoch
To Jud Mccranie
Subject Re: Why I Like Tp 5.5 Ide (continued)
JM> What if you had to think about which pedal to press each time while
JM> driving? That would be a mess. But with the 6.0 IDE you have to
JM> think about it each time, unlike the previous versions.
Come on, that's just nonsense. *You* have to think about it, because you're
new to the 6.0 IDE. Anyone who uses it much learns the new keys just the
way you learned the old Wordstar keys.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/20 11:34:20
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-18-92 17:31:14
From Dj Murdoch
To Mike Wilson
Subject Re: Runtime Error 200 On An Xt.
MW> Okay, what would you use for a do all catch all {$g+}
MW> grep? I think I have tried the -l but I have tried
MW> everything else I can find and this still seems to be a problem...
I'd use:
grep -r- -i+ "g+" *.*
and probably turn up a fair bit of junk, but would be sure to turn up what
I was looking for if it was there.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/20 11:34:20
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-18-92 17:32:34
From Dj Murdoch
To David G. Edwards
Subject Re: Pascal Structure Philosophy
DG> That brings up something I'd like to see in a future
DG> version of TP: I'd like to look at the compiler's output
DG> like the CPU window in TD.
You know about my DUMPPROG utility? It does a dump something like the TD
window. I'm thinking about a new release; just looking for a 486-aware disassem
ler first. Once I get that, I'll finish off some work I've done on resolving
numeric addresses as symbolic names.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/20 11:34:20
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-18-92 20:21:18
From Dj Murdoch
To Dale Frakes
Subject Re: Variable # parameters
DF> Does anyone out there know how to write a pascal (TP 6.0)
DF> function or procedure that accepts a variable number of
DF> parameters. I assume this is possible, since Write,
DF> Writeln, Read, Readln, Concat, etc all accept variable
DF> number of parameters, and they are written in Pascal. Has
DF> someone who has seen the source for the Run Time Libraries
DF> know how this is done? Again, I would assume that if
DF> someone can compile the RTL, it can be done within the Pascal environment.
No, you can't do it even if you have the RTL, unless you want to call your
procedure Writeln, Read, Readln, Concat, etc., and lose access to the real
one. Those names are hard coded into a part of the RTL for which you don't
get source (it's not Pascal, it's probably produced by another program), and
the compiler has special code for those particular functions/procedures and
no others.
One solution is the one used by TurboVision: have your function work on lists
and produce a pointer to a list, so that you can just add parentheses to your
heart's content (see the TV manual for examples). I think a better solution
is to just live with the fact that the number of parameters is fixed, and
design around it.
What particular use do you have in mind?
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/20 11:34:20
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-18-92 20:31:22
From Dj Murdoch
To Chris Long
Subject Re: Obsolete pascal??
CL> -> Hi everyone! I would like to know if the Pascal Language is going to
CL> -> become obsolute in the next 5 years!
CL> Nonsense. The language is powerful, flexible, easy to
CL> learn, and fun to program in. Those are winning
CL> attributes... Of course, the industry has adopted C as
CL> its preferred language, so C will undoubtedly be more
CL> popular than pascal.... But, that will not make the language obsolete.
I'd say that Standard Pascal is close to obsolete right now. I would never
use it, nor would I recommend that anyone else use it. Turbo Pascal, on the
other hand, is a useful language that will probably still be popular in 5
years. It's not compliant with the Pascal standard, though, so I wouldn't
call it Pascal.
It's possible that Extended Pascal will be around in 5 years. I don't know
if it will catch on or not; I tend to doubt it, but hope otherwise. Its big
problem is that Turbo Pascal isn't compatible with it either, so it doesn't
really stand a chance on the PC unless Borland chooses to adopt it.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/20 11:34:21
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 08:20:53
From Dj Murdoch
To ANDREW BROUGHTON
Subject Re: Variable-Length Records
AB> Thanks for replying. I thought of that, but my situation
AB> is unique. The database already exists, and will be
AB> updated maybe only once a year or so, so the updating
AB> procedure does not have to be fast or careful. The main
AB> problem is, the database is about 4 megs, containing more
AB> than 250,000 SINGLE FIELD records. Now to create an index
AB> file is the usual way, but the index file would be as big
AB> as the database file!
Don't put keys into the index file, just put the offset of the start of the
corresponding record. Because of the size, you'll need to use longint offsets;
that means the index will be about 1 Meg. It might be worth your while to
do some fiddling and create 3 byte integers; that would reduce the size of
the index to 750K.
AB> So far, I can only see 2 ways
AB> to deal with this: One is to copy the database over, and
AB> make each record the same length, (and probably doubling
AB> the size), or just do the binary search as if the file
AB> were made up of records all of the same size, and when the
AB> seek is done, increment or decrement the file pointer
AB> until it is on the start of a record, then check it, then
AB> continue the search.
The second method would work well, if you could easily recognize the start
of a record. If they contain binary data, that won't be easy. If they're
just text strings, and you're sure certain characters will never occur (e.g.
high ascii, or control characters) you could easily construct a signature
to put at the start of a record that couldn't possibly occur anywhere else.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/20 11:34:21
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 08:30:55
From Dj Murdoch
To Jud Mccranie
Subject Re: TP 6 Bad design
JM> I ran them from EXE files. To be sure, I did it again.
JM> TP 286 seconds
JM> 5.5 N/A 22.24
JM> 6.0 G- 22.90
JM> 6.0 G+ 22.96 (even though the EXE was 1.3% smaller than above)
Did you recompile before re-running? A significant part of that difference
could just be load time; if the 5.5 .EXE is contiguous on the disk, near the
FAT, it'll load noticeably faster than an .EXE that's badly fragmented.
Another possibility is that your disk cache may have the 5.5 code already
in it (because it's on the disk near something that you've just used).
Timing .EXEs isn't easy. I'd only trust the timings if you've been running
them from a ramdisk.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/20 11:34:21
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 08:35:43
From Dj Murdoch
To Joshua Kersey @ 930/22
Subject Re: Are you listening... ?
JJM> If you don't do scientific or engineering calculations... JJM> there
is very little in it for you. What I am asking for is a JJM> type REAL exponenti
tion operator (NOT a function, but an JJM> OPERATOR, like + or * ) which can
raise a real number to a real JJM> (non-integer) power.
JK> Ahhh...I seee, yes, I've been needing one too, and yes,
JK> I'll agree! "**" Does sound like a very good operator to
JK> use too...good idea. ..
But JJ isn't ambitious enough. There's no problem writing a function to raise
a real number to a real power. The hard thing is writing an operator that
raises integers to integer powers, reals to integer powers, or reals to real
powers, all with the same syntax, and all choosing efficient ways to do the
calculation.
For example,
Pi**2.0
should be calculated as Exp(2.0*ln(Pi)), but
Pi**2
should be calculated as Pi*Pi, and
2**10
should be calculated as 1 shl 10.
(Actually, all of the above should be calculated by the compiler, and the
value should be put into the expression; but the calculations I give are the
method to use if the constants were variables.)
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/20 11:34:22
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 04:49:32
From Trevor Carlsen
To Daniel Walton
Subject Re: BLOCKWRITE QUESTION.
DW> I haven't had a chance to test it yet, but I read a
DW> paragraph in "Mastering Turbo Pascal 6" by Scott D. Palmer
DW> that says otherwise. It says, " One potential pitfall, if
DW> you do use Blockwrite, is that it inserts an end-of-file
DW> character (Ctrl-Z) at the end of a block. This means that if
DW> a block ends in the middle of an existing file and you look
DW> for the end of the file by using the EOF function, your
DW> program will stop at the end of the block." Am I just
DW> reading this wrong or what?
I would suggest that, if that is a direct quote, you are reading it correctly.
The trouble is it is very wrong! If the man can make a statement that is
a stuff up of that magnitude, it does not auger well for the quality of the
rest of the book.
I think "Mastering Turbo Pascal 6" is also the title of a book by Tom Swan
which has received rave reviews here. I have not seen it but other books
by him are of excellent standard.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/21 11:38:09
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 05:15:07
From Trevor Carlsen
To Andrew Broughton
Subject Variable-Length Records
AB> I have a database that is about 4.5 megs, containing over
AB> 250,000 one-field entries. The database is already sorted in
AB> alphabetical order...
Mmmm... I think that (sorted in alpha) is the little bit of vital information
previously not given :-). (You previously stated that it was sorted but not
how it was sorted.)
AB> An index file would be too big, and a memory variable would
AB> be impossible. The conclusion that I've come to so far is to
AB> treat the file as if it contained equal-length records, then
AB> start the binary search. If the file pointer lands in the
AB> middle of a record, then Inc or Dec it until it gets to the
AB> beginning of the record.
Here is an idea that would make your search *very* much easier and faster.
It would also involve an index file of fixed size (52728 bytes).
First create a "mediumint" type! (Necessary so that the array will fit in
one segment)
type
MediumInt = array[0..2] of byte;
Create an array['A'..'Z','A'..'Z','A'..'Z'] of MediumInt, then read each record
of the file and store the offset of each record whose first three characters
differ from the previous records first three characters in this array. For
the example we'll call this array - "Offsets".
Then to find the first name SMITH, all that is required is to -
seek(f,Medium2Long(Offsets[name[1],name[2],name[3]]);
You can then either sequentially search all records from that offset on until
the appropriate one is found or not found (by reaching SMJ) or you can BlockRead
the whole file between SMI and SMJ and do a Boyer-Moore search of the buffer.
The latter method would mean you would find the record you want in under
1/10th second if all records starting "SMI" were less than one segment in
size.
If you want code for using a "mediumint" I will post it.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/21 11:38:09
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 06:06:38
From Trevor Carlsen
To Andrew Broughton
Subject Variable-Length Records
My previous message to you contains a small error. In the line that reads -
"...read each record of the file and store the offset of each record..."
^^^^
Change that to -
"...read each record of the file and store the offset of the first record..."
^^^^^^^^^
Sorry 'bout that!
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/21 11:38:10
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 08:04:55
From Trevor Carlsen
To Steve Sparks
Subject Re: Hacking the Network
Final WARNING:
This thread has no place in this conference. Take it elsewhere immediately.
If you, or anybody else, wish to reply to this message do so by netmail only.
Trevor Carlsen
Moderator.
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/21 11:38:11
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 08:19:02
From Trevor Carlsen
To Ashley Nichols
Subject Pascal 6.0
AN> How do you write a linked list to disk? And how can you tell
AN> the differnce between the different ones? I can insert
AN> things into the list, but yet I can't tell the difference
AN> between them. I don't know anything about linked lists, and
AN> so I would like all the help I can get!
Obviously the pointer parts of a linked disk mean nothing if written to disk.
So just traverse the list writing the relevant parts of each record to a disk
record.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/21 11:38:11
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 08:21:20
From Trevor Carlsen
To Gene Buckle
Subject Re: Bbs Source.. / Range Checking
GB> The variable is being set to false as the first command in
GB> the main begin..end clause. I'm not terribly concerned
GB> about it right now as I don't have the time to work on the
GB> program anymore. Thanks for the info. Might save me some
GB> time on a later project.
OK. So the rcs variable is somehow getting trashed. Watch it in the debugger.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/21 11:38:11
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 17:41:09
From Trevor Carlsen
To Jud Mccranie
Subject Re: Pascal, The Language
TC> difficulties of using assembler. The power of a language is
TC> not how easy it is for a programmer to achieve something in
TC> that language but how efficient and capable the language is in
TC> executing that something.
JM> Again you're equating execution speed and small size to
JM> power...
No way! Execution speed and size have no real relationship to the power of
a language. They are directly related to the efficiency of a language.
JM> ...The power of the language is its power in expressing what
JM> we need it to.
Exactly - or perhaps instead of the second "power" you could say "capability".
Either way you put it better than I did. If a language "A" cannot do something
at all and language "B" can do that something, regardless of how easy or hard
it is to achieve that, and language "B" can also do everything that language
"A" can, then language "B" is obviously the more powerful. That is the case
with TP and assembler. Execution wise, assembler can do everything TP can
but TP cannot do everything that assembler can. There are some things that
simply cannot be done in TP, no matter how adept you are with the language.
Therefore assembler is more powerful than TP. As a bonus it is also more
efficient (faster) and produces much smaller executable code and makes things
safer and easier for the programmer with its strong type checking, user defined
types etc.
Your definition of power appears to be how easy a language makes programming
a particular task. I think I would call that its usability.
JM> If I wanted a program to run 3 times as fast I could buy a
JM> computer 3 times as fast as what I have now for $3000. To
JM> code everything in assembler to make it 3x faster would take
JM> programmer-centuries.
At no time would I consider suggesting that someone produces entire applications
in assembler. That would often be tantamount to economical suicide. All
I am suggesting is that those selected parts of a program that a user may
perceive to be slow should be critically examined - probably with the help
of a profiler - and an intelligent decision made as to whether there would
be any user benefit in recoding small critical parts in assembler. Often
just a few lines of assembler can result in massive time savings.
JM> In my big program, printing takes a long time, unless a
JM> print spooler is used. Otherwise, the longest it takes for
JM> anything is about 3 seconds to read in the files at the
JM> beginning. Everything else that the user does takes less
JM> than a second. Coding in assembler isn't going to speed up
JM> the i/o appreciably. Everything else is fast enough as far
JM> as the user is concerned. Cutting that 0.5 second to 0.2
JM> second by using assembler would take much more effort than
JM> it is worth.
Fine, and I would usually agree with you there. What I am trying to say however
is that by not learning or using assembler, you are severely crippling yourself
by denying yourself the tools for that inevitable time when some assembler
is needed and is essential. Make no mistake, as a professional programmer
that time *will* come, if you are not willing to take advantage of every opportu
ity, you may as well throw money down the gurgler.
Just so there is no misunderstanding I reiterate, I rarely use assembler,
in fact I avoid it like the plague, I am not extra good at it, but ..., I
would never say I don't use it or have no need of it. I'm too fond of the
folding stuff to do that! :-)
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/21 11:38:12
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 08:55:48
From Trevor Carlsen
To Jud Mccranie
Subject Re: Tp 6.0 Ide
TC> In any testing a fundamental rule involves testing the limits,
TC> upper and lower, of all data. This involves stack limits, heap
TC> limits, the whole works. In the IDE it would be difficult, if
TC> not impossible to do this properly. TSRs and ISRs cannot
TC> really be tested at all from the IDE unless you are fond of
TC> rebooting!
JM> OK, I don't know about TSRs and ISRs since I've never
JM> written one. They must be different than app progs. As far
JM> as the stack and heap limits, they are larger when running
JM> the EXE, so if you don't hit the limit in the IDE the EXE
JM> won't either.
You have either misunderstood or chosen to misinterpret what I have said.
It is *essential* in testing any application that you *do* hit the design
limits. This is really the only way you can be sure that your program will
behave as you want it too when it is working to absolute maximum. It is not
much use to sell a program that crashes when some limit is reached because
this behaviour was never tested before release.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/21 11:38:12
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 16:53:41
From Trevor Carlsen
To Jud Mccranie
Subject messages
cc: Greg Smith (all versions)
JM> I got a message from one Greg Smith telling me to quit
JM> sending him messages about Pascal. But I only replied to
JM> messages on the Pascal echo from a Greg Smith. Is Greg #2
JM> being confused by messages to Greg #1?
Almost certainly. The name is probably not that uncommon. We also have two
Greg Smiths here in Australia on the network. There is bound to be more than
just the two you have discovered in the US, one of whom is well liked and
well respected in this echo. The complaint shows a real lack of BBS "sense"
and awareness of the scope of these conferences. Treat it with the contempt
it deserves and ignore it.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/21 11:38:12
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 16:53:20
From Trevor Carlsen
To Greg Smith
Subject (All GS versions!)
Original to Jud McCranie in reply to the following quote...
JM> I got a message from one Greg Smith telling me to quit
JM> sending him messages about Pascal. But I only replied to
JM> messages on the Pascal echo from a Greg Smith. Is Greg #2
JM> being confused by messages to Greg #1?
Almost certainly. The name is obviously not all that uncommon. We also have
two Greg Smiths here in Australia on the network. There is bound to be more
than just the two you have discovered in the US, at least one of whom is well
liked and well respected in this echo. The complaint shows a real lack of
BBS "sense" and awareness of the scope of these conferences. Treat it with
the contempt it deserves and ignore it.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/21 11:38:12
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 09:12:23
From Trevor Carlsen
To Jud Mccranie
Subject Re: C++ products
JM> I haven't done any C (except for a couple of trivial progs),
JM> but I agree with you! In fact, I've just read several
JM> messages advising beginners to "learn Pascal first then move
JM> up to C". Why not learn Pascal and stick with it???? I
JM> guess it depends on two issues: portability and the level of
JM> the app.
I reckon there is a third important one - the age and aspirations of the learner
If, like me, s/he is a little older than most and has no ambitions to ever
become a professional programmer in the sense of entering that job market,
then it is of little consequence to learn C, as TP will do everything C does,
often faster and more efficiently.
However, if the learner is young and does wish to make himself more marketable
in the job market, then a thorough grounding in as many languages as possible,
*particularly* C, is indicated.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/21 11:38:13
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 10:20:13
From Trevor Carlsen
To Jud Mccranie
Subject Re: TP 6 Bad design
JM> I ran them from EXE files. To be sure, I did it again.
JM> TP 286 seconds
JM> 5.5 N/A 22.24
JM> 6.0 G- 22.90
JM> 6.0 G+ 22.96 (even though the EXE was 1.3% smaller
JM> than above)
JM> Of course, the 0.06 seconds isn't significant, it may be
JM> when the tick occured. I have R-, A+, S-, I- in the source.
JM> One more thing, I have {$M 65520, 0, 6553600} which (in tp
JM> 5.5) makes it 4% faster than not having the line. I haven't
JM> tested w/ and w/o that line in 6.0. A+ is 2% faster, S- is
JM> 8% faster, in my old tests.
Two things here surprise me. The first is that 5.5 is faster and the second
is that the memory directive has so much effect.
Could you write a short demo that illustrates this first point and post it
here? As for the second point, I cannot reproduce that nor think of why it
should be. I'll be interested to see the code.
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/21 11:38:13
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 10:28:19
From Trevor Carlsen
To Gavin Campbell
Subject Screen Save
GC> X: FillChar(screensave, SizeOf(screensave));
GC> Well I had a couple problems compiling this. First on
GC> line six it said '=' expected. So i fixed that. But on the
GC> fillchar command it said ',' needed. I dont know how to fix
GC> that. other than that its just what i wanted.
It may surprise you, but the answer is contained on page 34 of the TP6 manual
and page 268 of the TP5.5 manual. Another surprise may be that it comes under
the explanation for the procedure FillChar. Try reading it.
Another way you could help yourself is to (from the IDE) place the cursor
on FillChar and press Ctrl-F1 ...
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/21 11:38:13
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 17:08:30
From Trevor Carlsen
To Gerald Gutierrez
Subject Echo policemen
GG> 1. Leave moderation to the moderator. Self appointed "echo policemen"
GG> only waste echo space and create ill-feeling.
GG> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GG> It's greatly appreciated if you could follow this one .. it saves
GG> a lot of unnecessary messages.
Mmm... reminds me of T S Eliot's quote - "You! hypocrite lecteur! -mon semblable
- mon frere!" which he got from Charles Baudelaire! :-)
TeeCee
--- TC-ED v2.01
* Origin: The Pilbara's Pascal Centre (+61 91 732569) (3:690/644)
* Tossed by SFToss v1.00b on 92/03/21 11:38:13
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 12:14:00
From Werner Berghofer
To Jud McCranie
Subject Tpascal mags.
Jud,
> Could two "Greg Smith"s cause this problem?
obviously there are at least two users called Greg Smith active in
this echo: the one Greg Smith from 1:104/441.8 and the other Greg Smith from
1:110/69. However, only the first Greg Smith seems to be interested in Pascal.
W.
---
* Origin: God is real... unless declared integer. (2:310/90.100)
* Tossed by SFToss v1.00b on 92/03/21 11:38:41
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-19-92 23:23:27
From Dj Murdoch
To David G. Edwards
Subject Stream errors
I noticed you asked your question about DOS errors in streams on Compuserve
again, and it made me curiouser. I have the TPW source, and I think the stream
code there is very close (identical?) to the stream code in TV. In all the
cases I checked, with the possible exception of GetSize (where something weird
was going on), the Error method gets called immediately after the DOS call
that fails. It has Info set to the value returned by DOS in AX, which is
the error code. It looks to me as though it would always be safe to ask DOS
for extended error information at that point.
You could probably also ask for it in the StreamError global procedure, but
there's a chance that some stream's Error method would already have messed
with it before you got a chance to see it. If you're writing this for your
own use, I'd do it that way, and make a note to myself to be careful when
overriding Error.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/21 11:40:27
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 08:48:45
From Dj Murdoch
To Jud Mccranie
Subject Re: TP 6.0 IDE memory
DM> It's probably too late to make any difference now, but what
DM> sort of changes were you looking for?
JM> Back to 5.5-style IDE, obviously.
No, you misunderstood my question. What sort of improvements on 5.5 were
you looking for?
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/21 11:40:27
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 08:49:44
From Dj Murdoch
To Dale Frakes
Subject Re: Turbo Vision Questions...
> And apart from the TStream class and its descendants, and the
> TStringList, and the TResourceFile. All of which are useful
> in programs that have nothing descended from TView.
DF> Aren't TStream, TStringList, and TResourceFile all
DF> decendants of TObject? I thought the only object in TV
DF> that isn't a decendant of TObject is TPoint (and TRect).
DF> Am I thinking about something in the wrong way? Is this
DF> why I'm having trouble with Turbo Vision?
You're right. The point is that you *can* pick and choose from the TObject
hierarchy; it's just the TView sub-hierarchy that you need to take or leave
as a whole.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/21 11:40:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 08:53:22
From Dj Murdoch
To Jud Mccranie
Subject Re: Exponentiation (was: Are you...)
JM> Great. Did I also hear that they're going to add complex?
I think type complex was in the standard. I don't know if anyone is going
to add it to a real compiler, but I'd guess VAX Pascal. They seem to be the
big standard supporters.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/21 11:40:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 08:55:52
From Dj Murdoch
To Terry Hughes
Subject Re: Binary Tree Linked L
TH> In the circles that I travel (database toolbox vendors and
TH> programmers) B-Tree is generally understood to mean Bayer-Tree
TH> -- Bayer being one of the inventors of this particular
TH> structure. It's different from a binary tree in that each node
TH> contains pointers to many subnodes, rather than just left/right
TH> subnodes and every node must be at least half-full. I believe a
TH> Bayer-Tree implies balancing as well but I don't have my
TH> reference here right now to check.
Thanks. I think I've heard that before, but I forgot it. Why don't they
just call them Bayer-Trees?
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/21 11:40:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 18:19:30
From Dj Murdoch
To Jud Mccranie
Subject Re: Obsolete Pascal??
JM> Interestingly, though, BASIC and FORTRAN have gone through such
JM> radical changes that old versions won't even come close to compiling.
JM> Pascal isn't that way, indicating that it was designed better.
Well, standard Pascal won't compile in TP, whereas Fortran 66 compiles fine
in Fortran 77 and probably in the latest standard as well. I think Fortran
is a much worse design than Pascal, but it has a lot of staying power.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/21 11:40:28
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 20:58:23
From Dj Murdoch
To Jud Mccranie
Subject Re: How to group procs in units
JM> How do you think it is best to organize your units? That is, should
JM> you
JM> 1. group procs into units according to functionality (e.g. all
JM> file handling together, all reports together, all editing
JM> together, etc)
JM> 2. group according to level (ones that don't call any other procs
JM> together, all procs that call only ones in the previous unit,
JM> etc)
JM> 3. Some combination of these two
JM> 4. Something else
Most of my programs use two quite different kinds of units. There are the
high level ones, that are specific to each program, and the low level service
units, which are shared among many programs. The organization is different
for the two kinds.
The high level units should be organized according to the organization of
the program. If a program does three "things", then there should be three
high level units, and perhaps a fourth which dispatches requests to the other
three. These units will handle all the high level functionality involved
in their particular task, and will call on the low level units to actually
carry out the tasks. If more than one task creates reports, then I may well
put the report generating capability separately into each of them. On the
other hand, if the reports are closely related, and should have the same appeara
ce, I'll make an intermediate level report writing unit, and the two high
level units will both make calls to it.
The low level units should be organized strictly according to functionality.
If I want to do something with a mouse, I'd expect to find it in the Mouse
unit. Something with strings should be in the Strings unit. (In actual fact,
the names for these are OPMouse and OPString :-).
The common thing tying both approaches together is the rule: Every unit in
a program should have a one line description. If I can't describe what a
unit does in one line, then there's something wrong with the way that unit
is designed. The different lines should be distinctive, too - it shouldn't
be hard to guess where a particular function/procedure/variable would be,
just from scanning a list of the one-liners. If it could be in either of
two units, then they should probably be merged, or at least rearranged, so
that the distinction between them is clearer.
In fact, the rule above is just a special case of the general rule: *everything
in a program should have a one line description. If I can't summarize what
something is in a single line, then it means I don't have a clear idea, and
it needs work.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/21 11:40:29
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
Conference 4
Date 03-20-92 21:16:36
From Dj Murdoch
To Daniel Walton
Subject Re: BLOCKWRITE QUESTION.
DW> I haven't had a chance to test it yet, but I read a
DW> paragraph in "Mastering
DW> Turbo Pascal 6" by Scott D. Palmer that says otherwise. It says, " One
DW> potential pitfall, if you do use Blockwrite, is that it
DW> inserts an end-of-file
DW> character (Ctrl-Z) at the end of a block. This means that if a block ends
DW> in the middle of an existing file and you look for the end
DW> of the file by using
DW> the EOF function, your program will stop at the end of the block."
DW> Am I just reading this wrong or what?
If that's an exact quote, then it's nonsense. TP 6 doesn't put a Ctrl-Z in
when it closes a file, and certainly doesn't put one in at the end of a block
written by BlockWrite.
--- Msg V3.2
* Origin: Murdoch's Point: Waterloo, Ontario, Canada (1:221/177.40)
* Tossed by SFToss v1.00b on 92/03/21 11:40:29